Change-Id: I68e60b155c583fa47aa5ca13d591851009a4e571
Reviewed-on: https://go-review.googlesource.com/37571
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
"strconv"
"strings"
"sync"
+ "sync/atomic"
)
var (
)
var cmdGoPath string
+var failed uint32 // updated atomically
func main() {
log.SetPrefix("vet/all: ")
default:
hostPlatform.vet(runtime.GOMAXPROCS(-1))
}
+ if atomic.LoadUint32(&failed) != 0 {
+ os.Exit(1)
+ }
}
var hostPlatform = platform{os: build.Default.GOOS, arch: build.Default.GOARCH}
} else {
fmt.Fprintf(&buf, "%s:%s: %s\n", file, lineno, msg)
}
+ atomic.StoreUint32(&failed, 1)
continue
}
w[key]--
for i := 0; i < v; i++ {
fmt.Fprintln(&buf, k)
}
+ atomic.StoreUint32(&failed, 1)
}
}
}