MCPcopy
hub / github.com/chain/Core / StringVar

Function StringVar

env/env.go:147–155  ·  view source on GitHub ↗

StringVar defines a string with the specified name and default value. The argument p points to a string variable in which to store the value of the environment var.

(p *string, name string, value string)

Source from the content-addressed store, hash-verified

145// which to store the value of the environment
146// var.
147func StringVar(p *string, name string, value string) {
148 *p = value
149 funcs = append(funcs, func() bool {
150 if s := os.Getenv(name); s != "" {
151 *p = s
152 }
153 return true
154 })
155}
156
157// StringSlice returns a pointer to a slice
158// of strings. It expects env var name to

Callers 2

StringFunction · 0.85
TestStringVarFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestStringVarFunction · 0.68