feat: disable GA events report by setting environment DISABLE_GA=true

This commit is contained in:
debugtalk
2022-04-05 11:49:29 +08:00
parent 87db9b302e
commit 1aefc9f698
8 changed files with 30 additions and 3 deletions
+5
View File
@@ -2,6 +2,7 @@ package sdk
import (
"fmt"
"os"
"github.com/denisbrodbeck/machineid"
"github.com/getsentry/sentry-go"
@@ -46,5 +47,9 @@ func init() {
}
func SendEvent(e IEvent) error {
if os.Getenv("DISABLE_GA") == "true" {
// do not send GA events in CI environment
return nil
}
return gaClient.SendEvent(e)
}