when import "golang.org/x/net/route"
it tells "build constraints exclude all Go files in go/src/golang.org/x/net/routego"
I am using VSCode editor on Windows/Linux
I searched online and didn't see a solution to the similar problem
package main
import (
"golang.org/x/net/route"
)
{
rib, _ := route.FetchRIB(0, route.RIBTypeRoute, 0)
messages, err := route.ParseRIB(route.RIBTypeRoute, rib)
}
We met the same error under Goland
, and it could be solved in this way
If you want to set GOOS = linux
under Mac, just add this line in the header of file // +build linux,amd64,go1.15,!cgo
which means we declare that this file is for the target system that has the following requirements: Linux, the AMD64 architecture, the 1.15 Go version, and no CGO support.
try to remove folder x in go/src/golang.org/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With