Skip to content

Commit f93186f

Browse files
committed
cmd/go/internal/telemetrystats: count cgo usage
Knowing how many times cgo is used is useful information to have in the local telemetry database. It also opens the door for uploading them in the future if desired. Change-Id: Ia92b11fc489f015bbface7f28ed5a5c2871c44f0 Reviewed-on: https://go-review.googlesource.com/c/go/+/707055 Reviewed-by: Michael Matloob <matloob@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Michael Matloob <matloob@google.com> Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
1 parent eaf28a2 commit f93186f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/cmd/go/internal/telemetrystats/telemetrystats.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ func incrementConfig() {
3232
} else {
3333
counter.Inc("go/mode:module")
3434
}
35+
36+
if cfg.BuildContext.CgoEnabled {
37+
counter.Inc("go/cgo:enabled")
38+
} else {
39+
counter.Inc("go/cgo:disabled")
40+
}
41+
3542
counter.Inc("go/platform/target/goos:" + cfg.Goos)
3643
counter.Inc("go/platform/target/goarch:" + cfg.Goarch)
3744
switch cfg.Goarch {

0 commit comments

Comments
 (0)