Skip to content

Instantly share code, notes, and snippets.

@daluu
Last active April 4, 2025 18:34
Show Gist options
  • Save daluu/0db2d41a661ce1c2441a62b50614cee8 to your computer and use it in GitHub Desktop.
Save daluu/0db2d41a661ce1c2441a62b50614cee8 to your computer and use it in GitHub Desktop.
golang notes/tips
alternate registry to fetch packages outside of go get: https://gopm.io/download?pkgname=golang.org/x/oauth2
alternate web sandbox for go: https://goplay.space/
https://medium.com/@nate510/don-t-use-go-s-default-http-client-4804cb19f779
https://github.com/beyondns/gotips
http://moazzam-khan.com/blog/golang-make-http-requests/
https://rodaine.com/2020/07/break-context-cancellation-chain/
https://blog.golang.org/context
---------------
go mod init
go list -m all
go clean -modcache
export GO111MODULE=false
go clean -testcache && go test -v ./...
go mod tidy -go=go1.24
go get -u ./...
go build -tags netgo -ldflags '-s -w -extldflags "-static"' -trimpath ./...
govulncheck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment