On Sun, Apr 24, 2022 at 10:17 PM hohoho syncxxx <just1cep4rt...@gmail.com> wrote: > > Hi, I meet that error in ubuntu too. And here is my env: > LLVM: 2c5590adfe09 > > gollvm: f17ba8c7708356ef447525e05cd6f2770845c7d7 > > gofrontend: e3bfc0889237a5bb8aa7ae30e1cff14f90a5f941 > > libffi: 0f2dd369cd5edcefad29b3fca4e1d08cb34f8f19 > > libbacktrace: d0f5e95a87a4d3e0a1ed6c069b5dae7cbab3ed2a > > When I compile the code: > package main > > import ( > "fmt" > "golang.org/x/sys/unix" > ) > > func main() { > fmt.Println("Hello, World!") > fmt.Println(unix.Getpagesize()) > } > > > It report another error: > > no required module provides package golang.org/x/sys/unix: go.mod file not > found in current directory or any parent directory; see 'go help modules'
If you haven't already, please run "go help modules". The short version is that you need to create a go.mod file (you can do this using "go mod init") and then run "go get golang.org/x/sys/unix". Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXGmN0zoLGBBASz%2BVXrziN99woTw3iTYKhQ1V_rVZxxkw%40mail.gmail.com.