From aae55f736d467f81dced6ab1d37d4128209f0962 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Thu, 26 Nov 2020 11:36:41 +0900 Subject: [PATCH] README: Make usage code more friendly (#1170) --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8f4c6fb04..0b13154fc 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,14 @@ _Go MySQL Driver_ is an implementation of Go's `database/sql/driver` interface. Use `mysql` as `driverName` and a valid [DSN](#dsn-data-source-name) as `dataSourceName`: ```go -import "database/sql" -import _ "github.com/go-sql-driver/mysql" +import ( + "database/sql" + "time" + + _ "github.com/go-sql-driver/mysql" +) + +// ... db, err := sql.Open("mysql", "user:password@/dbname") if err != nil {