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

Function setDefaults

internal/driver/options.go:32–56  ·  view source on GitHub ↗

setDefaults returns a new plugin.Options with zero fields sets to sensible defaults.

(o *plugin.Options)

Source from the content-addressed store, hash-verified

30// setDefaults returns a new plugin.Options with zero fields sets to
31// sensible defaults.
32func setDefaults(o *plugin.Options) *plugin.Options {
33 d := &plugin.Options{}
34 if o != nil {
35 *d = *o
36 }
37 if d.Writer == nil {
38 d.Writer = oswriter{}
39 }
40 if d.Flagset == nil {
41 d.Flagset = &GoFlags{}
42 }
43 if d.Obj == nil {
44 d.Obj = &binutils.Binutils{}
45 }
46 if d.UI == nil {
47 d.UI = &stdUI{r: bufio.NewReader(os.Stdin)}
48 }
49 if d.HTTPTransport == nil {
50 d.HTTPTransport = transport.New(d.Flagset)
51 }
52 if d.Sym == nil {
53 d.Sym = &symbolizer.Symbolizer{Obj: d.Obj, UI: d.UI, Transport: d.HTTPTransport}
54 }
55 return d
56}
57
58type stdUI struct {
59 r *bufio.Reader

Callers 5

TestFetchWithBaseFunction · 0.85
TestShellFunction · 0.85
PProfFunction · 0.85
TestParseFunction · 0.85
TestSymbolzAfterMergeFunction · 0.85

Calls 1

NewFunction · 0.92

Tested by 4

TestFetchWithBaseFunction · 0.68
TestShellFunction · 0.68
TestParseFunction · 0.68
TestSymbolzAfterMergeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…