I am learning how to create packages and documentation with Go and I cannot get godoc to work on my M1 Macbook Pro. I have installed it via
go install golang.org/x/tools/cmd/godoc@latest
and when I try to run
godoc -http=:8080
my terminal says: zsh: command not found: godoc
any help would be greatly appreciated.
I have also tried running export PATH="$GOPATH/bin:$PATH"
to no avail, based on the answers in another SO thread.
I saw some answers about editing ~./zshrc however I have no such file on my computer and dont know how to edit it anyway. If that is the answer help there is appreciated as well!
results of go version:
go version go1.19.4 darwin/arm64
Results of which go:
/usr/local/go/bin/go
Results of go env:
GO111MODULE="" GOARCH="arm64" GOBIN="" GOCACHE="/Users/ouris/Library/Caches/go-build" GOENV="/Users/ouris/Library/Application Support/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="arm64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/ouris/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/ouris/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64" GOVCS="" GOVERSION="go1.19.4" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/dev/null" GOWORK="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage- length=0 -fdebug-prefix-map=/var/folders/kl/1xcqlnwx7s142gkt4w245lm00000gn/T/go- build1954240093=/tmp/go-build -gno-record-gcc-switches -fno-common"