Skip to content

Instantly share code, notes, and snippets.

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

Embed
What would you like to do?
2nd part
func init() {
router = chi.NewRouter()
router.Use(middleware.Recoverer)
dbSource := fmt.Sprintf("root:%s@tcp(%s:%s)/%s?charset=utf8", dbPass, dbHost, dbPort, dbName)
var err error
db, err = sql.Open("mysql", dbSource)
catch(err)
}
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.