MCPcopy Create free account
hub / github.com/AdRoll/baker / SetGCPercentIfNotSet

Function SetGCPercentIfNotSet

input/inpututils/gogc.go:11–18  ·  view source on GitHub ↗

SetGCPercentIfNotSet sets the GC target percentage, unless GOGC environment variable is set, in which case SetGCPercentIfNotSet doesn't not override it and let it as is.

(percent int)

Source from the content-addressed store, hash-verified

9// variable is set, in which case SetGCPercentIfNotSet doesn't not override it
10// and let it as is.
11func SetGCPercentIfNotSet(percent int) {
12 gogc := os.Getenv("GOGC")
13 if gogc != "" {
14 return
15 }
16
17 debug.SetGCPercent(percent)
18}

Callers 1

NewListFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected