MCPcopy Index your code
hub / github.com/chain/Core / StringSliceVar

Function StringSliceVar

env/env.go:173–182  ·  view source on GitHub ↗

StringSliceVar defines a new string slice with the specified name. The argument p points to a string slice 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

171// points to a string slice variable in which
172// to store the value of the environment var.
173func StringSliceVar(p *[]string, name string, value ...string) {
174 *p = value
175 funcs = append(funcs, func() bool {
176 if s := os.Getenv(name); s != "" {
177 a := strings.Split(s, ",")
178 *p = a
179 }
180 return true
181 })
182}
183
184// Parse parses known env vars
185// and assigns the values to the variables

Callers 2

StringSliceFunction · 0.85
TestStringSliceVarFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestStringSliceVarFunction · 0.68