Skip to content

Dev test tips and tricks

David Shiflet edited this page Feb 14, 2023 · 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:

C:\git\go-sqlcmd>build\build
C:\git\go-sqlcmd>docker run --rm  -e SQLCMDUSER=sa -e SQLCMDPASSWORD=yourpassword -e SQLCMDSERVER=yourserver -v i:\git\go-sqlcmd:/go-sqlcmd -w /go-sqlcmd golang:1.19 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