From 6f93b2bcbeffadd845bc8e82e0beda9d2f6ed19b Mon Sep 17 00:00:00 2001 From: astaxie Date: Tue, 26 Nov 2013 17:16:35 +0800 Subject: [PATCH] fix _ "github.com/go-sql-driver/mysql" --- session/README.md | 4 +--- session/sess_mysql.go | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/session/README.md b/session/README.md index bdddabe3..ebc25a5a 100644 --- a/session/README.md +++ b/session/README.md @@ -46,9 +46,7 @@ Then in you web app init the global session manager go globalSessions.GC() } -* Use **MySQL** as provider, the last param is the DSN, learn more from [mysql](https://github.com/go-sql-driver/mysql#dsn-data-source-name),but first you should import mysql: - - import _ "github.com/go-sql-driver/mysql" +* Use **MySQL** as provider, the last param is the DSN, learn more from [mysql](https://github.com/go-sql-driver/mysql#dsn-data-source-name): func init() { globalSessions, _ = session.NewManager( diff --git a/session/sess_mysql.go b/session/sess_mysql.go index 8699be23..10dcf20b 100644 --- a/session/sess_mysql.go +++ b/session/sess_mysql.go @@ -9,6 +9,7 @@ package session import ( "database/sql" + _ "github.com/go-sql-driver/mysql" "sync" "time" )