# go: inconsistent build constraints: //go:build linux && !linux

- **ID:** `go/build-constraint-conflict`
- **Domain:** go
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A file has contradictory build tags that cannot be simultaneously true, causing the file to be ignored or causing a build error.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.18 | active | — | — |
| 1.21 | active | — | — |
| 1.22 | active | — | — |

## Workarounds

1. **Correct the build constraint to be logically consistent.** (95% success)
   ```
   Change '//go:build linux && !linux' to a valid constraint like '//go:build linux'.
   ```
2. **Use separate files for different platforms with proper build tags.** (90% success)
   ```
   Create platform-specific files (e.g., file_linux.go, file_windows.go) with correct tags.
   ```

## Dead Ends

- **Removing all build constraints from the file.** — The file will be built for all platforms, which may cause compilation errors on unsupported OS. (60% fail)
- **Adding more build constraints to override.** — More constraints can create further conflicts; the logic must be consistent. (80% fail)
