Enrich the Go Guide Code Style whit extraction to install and use goimports
Problem to solve
When I try to solve errors of import in the test pipeline, I get the error Some files are not formatted. Please format with
goimports -w -local ``gitlab.com/gitlab-org`
Following the instructions in the documentation, an attempt was made to rectify this error. However, the command 'goimports' was not recognized, resulting in the error message' zsh: command not found: goimports
'.
Proposal
Add a section in the documentation of how to use the goimports
(or any cli tool of go) from the terminal for other developers like me will able to use this
I want to add the instructions for how to add the go package directory to the PATH
. This is a one-time action, and no need to do this for every tool you install
Instructions
- Install the tool as the documentation proposes.
- Get the go package directory by running this command in the terminal
go env GOPATH
- Run this command to add the location from the previous step
export PATH="{GOPATH}/bin:$PATH"
\ - Run
source ~/.zshrc
to refresh the configuration - Using the tool you just installed
Who can address the issue
Other links/references
/cc @tkopel
Edited by Miki Amos