Skip to content

Instantly share code, notes, and snippets.

@lku
Last active March 24, 2023 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lku/fe1eb3df71399fa1537a1a7627f0a179 to your computer and use it in GitHub Desktop.
Save lku/fe1eb3df71399fa1537a1a7627f0a179 to your computer and use it in GitHub Desktop.
package main
import (
"user"
)
func main {
db := createDB
// Setup user package dependencies
user.SetDB(DB)
}
package user
import (
"database/sql"
}
var db *sql.DB
func SetDB(db *sql.DB) {
db = db
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment