# default path according: https://go.dev/doc/install
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
# go libraries/packages path
export GOPATH=/home/soft/go_lib
go install github.com/bazelbuild/buildtools/buildifier@latest
can't load package: package github.com/bazelbuild/buildtools/buildifier@latest: cannot use path@version syntax in GOPATH mode
GOPATH=/home/projects/goroot
go install github.com/bazelbuild/buildtools/buildifier
cd $GOPATH/src/github.com/bazelbuild/buildtools/buildifier
bazel build :all
possible (didn't check it) alternative way
go mod init buildifier
# go mod init .
go mod download repo@version
# go mod download github.com/bazelbuild/buildtools/buildifier@latest
/home/projects/goroot/bin/buildifier -mode fix {file_path}
# bazel run //bazel/tools/buildifier:fix