Go: Difference between revisions
Appearance
NickPGSmith (talk | contribs) |
NickPGSmith (talk | contribs) |
||
| Line 6: | Line 6: | ||
gofmt -w . | gofmt -w . | ||
gofmt -d test.go | gofmt -d test.go | ||
Initialise project, create go.mod file: | Initialise project, create go.mod file: | ||
| Line 19: | Line 17: | ||
Note the go.sum file that contains anti-tampering checksums. | Note the go.sum file that contains anti-tampering checksums. | ||
=== Useful Packages === | |||
* [https://github.com/alexflint/go-arg alexflint/go-arg] | * [https://github.com/alexflint/go-arg alexflint/go-arg] | ||
* ? | * ? | ||
Revision as of 08:38, 23 January 2026
Building and Packages
go run test.go go build test.go gofmt -w . gofmt -d test.go
Initialise project, create go.mod file:
go mod init example-project
Download, and add reference to go.mod file:
go get github.com/alexflint/go-arg
Ensure go.mod is in sync with code imports:
go mod tidy
Note the go.sum file that contains anti-tampering checksums.