The error occurs because every Go file in the directory has build constraints that exclude the current operating system or architecture. Add a file without constraints or remove the constraints from existing files.
//go:build !windows
// +build !windows
package main
func main() {
// This file is excluded on Windows
}
To fix it, ensure at least one file in the package has no build constraints or a constraint that matches your environment (e.g., remove //go:build ignore or //go:build !linux if you are on Linux).