Not usable with Go 1.18 due to outdated golang.org/x/sys/unix dependency
pscheid92 opened this issue · comments
TL;DR
We need to update the golang.org/x/sys/unix
dependency.
There is already an open pull request to do that: #71
Description
Context
This error is due to a fixed bug in golang.org/x/sys/unix
(see golang/go#49219).
To benefit from this bugfix, we have to update the version here.
Since github.com/mattn/go-isatty
is a dependency for github.com/gin-gonic/gin
, those are also affected (gin-gonic/gin#3082).
Workaround
When you see the below error, run go get -u golang.org/x/sys
to force an upgrade to the newest golang.org/x/sys/unix
version. This has to be done at least for every new project.
Reproduction
Steps
- Copy usage example from README file
- Try to build/run it with Go 1.18 or Go 1.18.1
Expectation
The project is built and runs.
Actual Behaviour
Build/run aborts with an error.
> go build .
# golang.org/x/sys/unix
../../Go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/syscall_darwin.1_13.go:25:3: //go:linkname must refer to declared function or variable
../../Go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/zsyscall_darwin_amd64.1_13.go:27:3: //go:linkname must refer to declared function or variable
../../Go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/zsyscall_darwin_amd64.1_13.go:40:3: //go:linkname must refer to declared function or variable
../../Go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/zsyscall_darwin_amd64.go:28:3: //go:linkname must refer to declared function or variable
../../Go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/zsyscall_darwin_amd64.go:43:3: //go:linkname must refer to declared function or variable
../../Go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/zsyscall_darwin_amd64.go:59:3: //go:linkname must refer to declared function or variable
../../Go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/zsyscall_darwin_amd64.go:75:3: //go:linkname must refer to declared function or variable
../../Go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/zsyscall_darwin_amd64.go:90:3: //go:linkname must refer to declared function or variable
../../Go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/zsyscall_darwin_amd64.go:105:3: //go:linkname must refer to declared function or variable
../../Go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/zsyscall_darwin_amd64.go:121:3: //go:linkname must refer to declared function or variable
../../Go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/zsyscall_darwin_amd64.go:121:3: too many errors