Skip to content

Instantly share code, notes, and snippets.

@s1s1ty s1s1ty/go-sql-2.go
Created Jul 18, 2018

What would you like to do?
2nd part
func init() {
router = chi.NewRouter()
dbSource := fmt.Sprintf("root:%s@tcp(%s:%s)/%s?charset=utf8", dbPass, dbHost, dbPort, dbName)
var err error
db, err = sql.Open("mysql", dbSource)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.