My code should support many types of OSs and archs.
Im using a netstat supporting lib ("github.com/cakturk/go-netstat/netstat") which is supported for windows and linux but not for darwin or arm64 arch.
I have 2 files to handle this issue packaged as netstatSafe. one that is marked with //go:build !darwin && !arm64 that utilizes netstat logics, and another thats marked with //go:build darwin || arm64, that only imports the “errors” package and has no logic other than returning an error that netstat isnt suported.
However - when running GOOS=windows GOARCH=arm64 go build - my build fails with:
package SomeService
imports SomeService/myLib1
imports SomeService/myLib2
imports MyInfra/netstatSafe: build constraints exclude all Go files in path/to/netstatSafe
The boolean conditions seem correct so I feel puzzled. When i created a few files with windows && !arm64 + linux && !arm64 + darwin && !arm64 + arm64 it worked - but this is not what the poet has meant - im sure.
Also tried go clean -modcache but it didn’t help
Would appreciate any assistance