Skip to content

Dev test tips and tricks

David Shiflet edited this page Sep 30, 2021 · 3 revisions

Use docker for testing

Testing on Linux is needed to isolate bugs that arise from platform differences. If your primary development environment is Windows, run the tests in Linux using docker. Example command line:

docker run --rm -e SQLCMDUSER=sa -e SQLCMDPASSWORD=yourpassword -e SQLCMDSERVER=yourserver -v i:\git\go-sqlcmd\cmd\sqlcmd:/go-sqlcmd -w /go-sqlcmd golang:1.16 go test ./...

"yourserver" may need to be an ip address.

The default CI pipeline also runs on a Linux agent so you can queue that build in ADO against your branch.

use the go playground for prototyping

https://play.golang.org/

Clone this wiki locally