Skip to content

Commit

Permalink
README: Make usage code more friendly (#1170)
Browse files Browse the repository at this point in the history
  • Loading branch information
methane committed Nov 26, 2020
1 parent cf72fd2 commit aae55f7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Expand Up @@ -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 {
Expand Down

0 comments on commit aae55f7

Please sign in to comment.