Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/go/analysis/cmd/vet: add -cgoinclude check for #include of code in subdirectories #26506
The go build model is that all code for a package is in one directory.
One of the few ways a package can violate this rule is by using
It seems reasonable for cmd/vet to notice such #includes and
Suggested in #26366.
OK, so I throw an error only when the include is in a subdir of the project, but not when it is directly in the same dir as the go file, and not when it's outside the src tree.
Got you right?
Should I throw a warning for the third case or just leave it be?
Hello @iamoryanmoshe, thank you for sending the CL and for taking this on!
As @mvdan and @thepudds had mentioned in the CL, these checks have moved from the standard library to https://godoc.org/golang.org/x/tools/go/analysis/cmd/vet aka https://github.com/golang/tools/tree/master/go/analysis/cmd/vet perhaps we can close the original CL and resurrect it by sending a CL to x/tools but also then I'll retitle this issue and we can even no longer tie it down to a specific release.