Project Based Learning (A.I).pptx detail explanation
Modules - Go west 2018-10-02
1. Go West
Here vgo again!
Modules in Go
Gothenburg’s Golang meetup!
2. Topics
● A bit of background
● Go Modules in 1.11
● Usage
● go.mod, go.sum
● Useful commands
● Demo!
3. Background
2009 - only a compiler and linker with makefiles, no packages
2010 - `goinstall`, current package structure
2011 - `go` command, with `go get` (v1 of Golang)
2013 - `godep`, deps stored in project, edits $GOPATH
2014 - `glide`, deps in vendor folder understood by `go`
2016 - `dep`, improved usability and flexibility
2018 - `vgo`, versioned Go proposal
4. Go Modules in 1.11
The official, final () solution… hopefully!
No `$GOPATH` with deeply nested folders
No `vendor/` folder
Fully Semver aware (using tags), unusual version selection
Built in to the `go` tool
Magic caching of packages, proxying etc
End of the versioning tools war
7. go.sum
Not really a lock file
More like a hash of packages
cloud.google.com/go v0.27.0
h1:Xa8ZWro6QYKOwDKtxfKsiE0ea2jD39nx32Rx
tF5RjYE=
cloud.google.com/go v0.27.0/go.mod
h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick
0ClmMTw=
...
8. Useful commands
List updates: `go list -m -u all`
Update: `go get -u pkg`...
...or by editing the version in `go.mod`
Cleanup: `go mod tidy`
Vendoring: `go mod vendor` (in case you still need it)
Help: `go help mod` and `go help go.mod`