A set of golang utility functions
- golang 1.15 or later
brew update && brew install go
GOOS=linux go build -o ./bin/desiredApp ./desiredApp
- docker 18.09 or later
brew update && brew cask install docker
DOCKER_BUILDKIT=1 docker build -o bin --build-arg APP=desiredApp .
DOCKER_BUILDKIT=1 docker build -o bin --build-arg APP=desiredApp --platform linux/386 .
These commands will compile the specified application and place the executable in the ./bin
directory. The binary can then be distributed as needed
- golang 1.15 or later
brew update && brew install go
go test -v ./gtb
=== RUN TestOpenBrowser
/usr/bin/open https://google.com
--- PASS: TestOpenBrowser (0.00s)
=== RUN TestGetUserInfo
--- PASS: TestGetUserInfo (0.00s)
=== RUN TestSplitMulti
--- PASS: TestSplitMulti (0.00s)
=== RUN TestAToUint32
--- PASS: TestAToUint32 (0.00s)
=== RUN TestGetFilesInDir
--- PASS: TestGetFilesInDir (0.00s)
PASS
ok github.com/seemywingz/gotoolbox/gtb 0.013s
- docker 18.09 or later
brew update && brew cask install docker
docker compose up
Starting gotoolbox_go-test_1 ... done
Attaching to gotoolbox_go-test_1
go-test_1 | === RUN TestOpenBrowser
go-test_1 | xdg-open https://google.com
go-test_1 | --- PASS: TestOpenBrowser (0.00s)
go-test_1 | === RUN TestGetUserInfo
go-test_1 | --- PASS: TestGetUserInfo (0.00s)
go-test_1 | === RUN TestSplitMulti
go-test_1 | --- PASS: TestSplitMulti (0.00s)
go-test_1 | === RUN TestAToUint32
go-test_1 | --- PASS: TestAToUint32 (0.00s)
go-test_1 | === RUN TestGetFilesInDir
go-test_1 | --- PASS: TestGetFilesInDir (0.01s)
go-test_1 | PASS
go-test_1 | ok gtb 0.013s
gotoolbox_go-test_1 exited with code 0