hcpxread
hcpxread copied to clipboard
undefined: unsafe.Slice: Bug or wrong version?
go get github.com/vlad-s/hcpxread
golang.org/x/sys/unix
go/src/golang.org/x/sys/unix/syscall.go:83:16: undefined: unsafe.Slice go/src/golang.org/x/sys/unix/syscall_linux.go:2270:9: undefined: unsafe.Slice go/src/golang.org/x/sys/unix/syscall_unix.go:118:7: undefined: unsafe.Slice go/src/golang.org/x/sys/unix/sysvshm_unix.go:33:7: undefined: unsafe.Slice
# apt install systemd-container debootstrap
# debootstrap --arch-amd64 buster vm-buster
# systemd-nspawn -D vm-buster/
root@vm-buster:~# apt install golang git
root@vm-buster:~# go version
go version go1.11.6 linux/amd64
# go get github.com/vlad-s/hcpxread
# golang.org/x/sys/unix
go/src/golang.org/x/sys/unix/syscall.go:83:16: undefined: unsafe.Slice
go/src/golang.org/x/sys/unix/syscall_linux.go:2270:9: undefined: unsafe.Slice
go/src/golang.org/x/sys/unix/syscall_unix.go:118:7: undefined: unsafe.Slice
go/src/golang.org/x/sys/unix/sysvshm_unix.go:33:7: undefined: unsafe.Slice
^d
any ideas? :)
(on stretch
even worse)
Hi! Unfortunately this is an old project and I didn't had the time to upgrade it to support go modules. Using go version go1.19.5
I was able to run go install github.com/vlad-s/hcpxread@latest
without any issues.
Would you be able to try running go get -u golang.org/x/sys/...
and see if that fixes the problem? It seems like the golang.org/x/sys/unix package doesn't have the unsafe.Slice that it expects.
unsafe.Slice was added as part of Go 1.17
via https://stackoverflow.com/questions/74049351/gcloud-functions-deploy-go-runtime-error-undefined-unsafe-slice-error-id-2f5
If not, you could try downloading a more recent version of go from their website and not through the package manager.
Sorry for replying so late, and thanks for opening this issue!