| 1 |
//go:build !antithesis_ignore |
| 2 |
// +build !antithesis_ignore |
| 3 |
|
| 4 |
package sample |
| 5 |
|
| 6 |
// Classify has a body to instrument. The point of this case is the build |
| 7 |
// constraints above: the instrumentor must keep both the //go:build and the |
| 8 |
// legacy // +build lines verbatim, and must place its own leading //line |
| 9 |
// directive ABOVE them. A //line is itself a line comment, which the build-tag |
| 10 |
// scanner skips over, so the constraints still gate compilation. The |
| 11 |
// antithesis_ignore tag is never set, so the constraints are always satisfied |
| 12 |
// and the file always compiles. |
| 13 |
func Classify(n int) string { |
| 14 |
if n < 0 { |
| 15 |
return "negative" |
| 16 |
} |
| 17 |
return "nonneg" |
| 18 |
} |