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

Function URLVar

env/env.go:113–130  ·  view source on GitHub ↗

URLVar defines a url.URL variable with the specified name ande default value. The argument p points to a url.URL variable in which to store the value of the environment variable.

(p *url.URL, name string, value string)

Source from the content-addressed store, hash-verified

111// in which to store the value of the environment
112// variable.
113func URLVar(p *url.URL, name string, value string) {
114 v, err := url.Parse(value)
115 if err != nil {
116 panic(err)
117 }
118 *p = *v
119 funcs = append(funcs, func() bool {
120 if s := os.Getenv(name); s != "" {
121 v, err := url.Parse(s)
122 if err != nil {
123 log.Println(name, err)
124 return false
125 }
126 *p = *v
127 }
128 return true
129 })
130}
131
132// String returns a new string pointer.
133// When Parse is called,

Callers 2

URLFunction · 0.85
TestURLVarFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestURLVarFunction · 0.68