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

Function checkValue

internal/driver/interactive_test.go:134–158  ·  view source on GitHub ↗
(p *profile.Profile, cmd []string, cfg config, o *plugin.Options)

Source from the content-addressed store, hash-verified

132}
133
134func checkValue(p *profile.Profile, cmd []string, cfg config, o *plugin.Options) error {
135 if len(cmd) != 2 {
136 return fmt.Errorf("expected len(cmd)==2, got %v", cmd)
137 }
138
139 input := cmd[1]
140 args := strings.SplitN(input, "=", 2)
141 if len(args) == 0 {
142 return fmt.Errorf("unexpected empty input")
143 }
144 name, value := args[0], ""
145 if len(args) == 2 {
146 value = args[1]
147 }
148
149 f, ok := configFieldMap[name]
150 if !ok {
151 return fmt.Errorf("Could not find variable named %s", name)
152 }
153
154 if got := cfg.get(f); got != value {
155 return fmt.Errorf("Variable %s, want %s, got %s", name, value, got)
156 }
157 return nil
158}
159
160func interleave(input []string, seed int64) []string {
161 var inputs [][]string

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…