MCPcopy Create free account
hub / github.com/google/pprof / addFlags

Function addFlags

internal/driver/driver_test.go:243–257  ·  view source on GitHub ↗

addFlags parses flag descriptions and adds them to the testFlags

(f *testFlags, flags []string)

Source from the content-addressed store, hash-verified

241
242// addFlags parses flag descriptions and adds them to the testFlags
243func addFlags(f *testFlags, flags []string) {
244 for _, flag := range flags {
245 fields := strings.SplitN(flag, "=", 2)
246 switch len(fields) {
247 case 1:
248 f.bools[fields[0]] = true
249 case 2:
250 if i, err := strconv.Atoi(fields[1]); err == nil {
251 f.ints[fields[0]] = i
252 } else {
253 f.strings[fields[0]] = fields[1]
254 }
255 }
256 }
257}
258
259func testSourceURL(port int) string {
260 return fmt.Sprintf("http://%s/", net.JoinHostPort(testSourceAddress, strconv.Itoa(port)))

Callers 1

TestParseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…