GitHub - arikama/go-mysql-test-container: Golang MySQL testcontainer package (original) (raw)
go-mysql-test-container
Golang MySQL testcontainer that makes integration testing MySQL a breeze
Usage
Execute
go get github.com/arikama/go-mysql-test-container
Code
package main
import ( "testing"
"github.com/arikama/go-mysql-test-container/mysqltestcontainer")
func Test(t *testing.T) { mySql, _ := mysqltestcontainer.Create("test") db := mySql.GetDb() err := db.Ping() if err != nil { log.L.Errorln(err.Error()) } }
Development
- Make sure Docker is installed on your local machine
- Make sure you can run Docker locally
- Run the test