R
R
rhaegal2019-01-27 23:38:51
go
rhaegal, 2019-01-27 23:38:51

How to work with goimports?

Hello!
I ran the command go get golang.org/x/tools/cmd/goimports.
When I run the goimports command, I get the error:
The 'goimports' program is not currently installed. You can install it by running:
sudo apt install golang-golang-x-tools.
When I run the go imports name.go command, I get the error:
go imports: unknown command
Run 'go help' for usage.
At the same time, gofmt works fine. What did you do wrong during installation? Or maybe I'm trying to use the goimports command wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
index0h, 2019-01-28
@rhaegal

Check your PATH variable. There should be a path to bin inside GOPATH

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question