Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: "go clean -cache" is an unknown command on fresh installs #59109

Closed
percivalalb opened this issue Mar 18, 2023 · 6 comments
Closed

cmd/go: "go clean -cache" is an unknown command on fresh installs #59109

percivalalb opened this issue Mar 18, 2023 · 6 comments
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@percivalalb
Copy link

percivalalb commented Mar 18, 2023

What version of Go are you using (go version)?

$ go version
go version go1.20.2 linux/arm64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/home/bob/.cache/go-build"
GOENV="/home/bob/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/bob/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/bob/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_arm64"
GOVCS=""
GOVERSION="go1.20.2"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="0"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build4151970831=/tmp/go-build -gno-record-gcc-switches"
GOROOT/bin/go version: go version go1.20.2 linux/arm64
GOROOT/bin/go tool compile -V: compile version go1.20.2
uname -sr: Linux 5.15.80-v8.1.el9.altarch

What did you do?

Installed golang on a Raspiberry PI and ran go clean -cache but got an "unknown command" error.

After running go install (I installed Hugo from it's source). go clean -cache is now a recongised command and doesn't error.

What did you expect to see?

I would expect the command to not say it is an unknown command on a fresh install and if there is nothing to clean, either exit with such a message or no message at all. Saying it is an "unknown command" is misleading.

$ go clean -cache
$ echo $?
0

What did you see instead?

$ go ​clean -cache
go ​clean: unknown command
Run 'go help' for usage.
@seankhliao
Copy link
Member

how did you install go?
I don't see how it's possible for clean to be an unknown command.

@seankhliao seankhliao added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 18, 2023
@percivalalb
Copy link
Author

percivalalb commented Mar 18, 2023

I was installing on my Raspberry PI 4 running Rocky9 - I have the commands on hand:

curl https://go.dev/dl/go1.20.2.linux-arm64.tar.gz --output /tmp/go.tar.gz --location
tar -zxvf /tmp/go.tar.gz -C /usr/local
echo 'export GOROOT=/usr/local/go' | tee -a /etc/profile.d/golang.sh
echo 'export PATH=$PATH:/usr/local/go/bin' | tee -a /etc/profile.d/golang.sh
source /etc/profile.d/golang.sh

Then immediately ran go clean -cache.
As I said after running go install github.com/gohugoio/hugo@latest it no longer happens 🤔 bizarre!

@seankhliao
Copy link
Member

is this a reproducible error?

@ALTree
Copy link
Member

ALTree commented Mar 18, 2023

You've got a zero width space character before clean (it's also in the command you pasted above):

image

https://www.soscisurvey.de/tools/view-chars.php

@percivalalb
Copy link
Author

Oh ahaha! Nice spot. No idea how that got there. Okey, no issue here. Closing...

@MarioVilas
Copy link

Just wanted to comment I was hit by the exact same error. Surprisingly when copying and pasting from Google! Apparently Google inserts that character there for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants