when import ""
it tells "build constraints exclude all Go files in go/src/"
I am using VSCode editor on Windows/Linux
I searched online and didn't see a solution to the similar problem
package main
import ( ""
)
{ rib, _ := route.FetchRIB(0, route.RIBTypeRoute, 0) messages, err := route.ParseRIB(route.RIBTypeRoute, rib)
} 3 5 Answers
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/
In my case I just by an accident replaced original code by test file, it was containing the following comments:
//go:build unittest
// +build unittest 1 "build constraints exclude all Go files in go/src/" In Intellij :
- Navigate to the folder in the project explorer
- Right click -> Mark folder as not excluded.
If you get error build constraints exclude all Go files in ... with go get command, please specify the path as follows
Error:
$ go get {HOST}/platform/be-photoSuccess:
$ go get {HOST}/platform/be-photo/external/client