wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
25.63k stars 1.24k forks source link

go install err #3518

Open PaiHL opened 6 months ago

PaiHL commented 6 months ago

Description

dev@devdeiMac-Pro code % go install github.com/wailsapp/wails/v2/cmd/wails@latest go: github.com/wailsapp/wails/v2/cmd/wails@latest (in github.com/wailsapp/wails/v2@v2.8.2): go.mod:5: unknown directive: toolchain

To Reproduce

dev@devdeiMac-Pro code % go install github.com/wailsapp/wails/v2/cmd/wails@latest go: github.com/wailsapp/wails/v2/cmd/wails@latest (in github.com/wailsapp/wails/v2@v2.8.2): go.mod:5: unknown directive: toolchain

Expected behaviour

dev@devdeiMac-Pro code % go install github.com/wailsapp/wails/v2/cmd/wails@latest go: github.com/wailsapp/wails/v2/cmd/wails@latest (in github.com/wailsapp/wails/v2@v2.8.2): go.mod:5: unknown directive: toolchain

Screenshots

No response

Attempted Fixes

No response

System Details

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/dev/Library/Caches/go-build"
GOENV="/Users/dev/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/dev/go/pkg/mod"
GONOPROXY="gitlab.forensix.cn"
GONOSUMDB="gitlab.forensix.cn"
GOOS="darwin"
GOPATH="/Users/dev/go"
GOPRIVATE="gitlab.forensix.cn"
GOPROXY="https://goproxy.cn,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.20.9"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
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 -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/lt/2lkcjlbx23qgj_kgc2ykbw4w0000gn/T/go-build3486414844=/tmp/go-build -gno-record-gcc-switches -fno-common"

Additional context

No response

lastgitforlife commented 6 months ago

Hi @PaiHL, I encountered a similar issue to this and found a solution. It appears to be from the toolchain command in go.mod, and looking it up that is a feature from Go 1.21. As you are using 1.20.9, try updating to at least 1.21 and try the commands again.

Cheers!

PaiHL commented 6 months ago

Hi @PaiHL, I encountered a similar issue to this and found a solution. It appears to be from the toolchain command in go.mod, and looking it up that is a feature from Go 1.21. As you are using 1.20.9, try updating to at least 1.21 and try the commands again.

Cheers!

是的,可以升级go版本解决。