Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Tips and Traps¶
The package
maintells the Go compiler that the package should compile as an executable program instead of a shared library. Themainfunction in themainpackage is the entry point of the program.mkdir myproj cd myproj go mod init legendu.net/myprojYou can play with Golang code in Go Playground. Even better, you can play with Golang code in a JupyterLab notebook using gonb . A pre-compile Docker images is also available at janpfeifer
/gonb _jupyterlab .
import "fmt"
import "reflect"
import "os/exec"Updating Dependencies¶
go get -ugo get example.com/some/module@latestCleaning up dependencies¶
go mod tidyVerifying dependencies¶
go mod verifygo get vs go install¶
Please refer to Deprecation of ‘go get’ for installing executables for detailed discussions.
References¶
https://
dave .cheney .net /practical -go /presentations /qcon -china .html https://medium.com/kdnotes/golang-naming-rules-and-conventions-8efeecd23b68