Grokking Advanced Go
Vote

0% completed

​

Tool Directives and Private Modules

The two commands below both give an engineer the formatter goimports, which adds and removes import lines in Go files. The first command installs whatever version is newest today into a directory on that engineer's machine. The second records one exact version in the project, so that everyone who runs the tool gets the same one.

go install golang.org/x/tools/cmd/goimports@latest go get -tool golang.org/x/tools/cmd/goimports

With the first command, two engineers who ran it a month apart can get different results from the same code

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content