MCPcopy Create free account
hub / github.com/codnect/procyon / NewEnvPropertySource

Function NewEnvPropertySource

runtime/environment.go:67–80  ·  view source on GitHub ↗

NewEnvPropertySource function creates a new EnvPropertySource.

()

Source from the content-addressed store, hash-verified

65
66// NewEnvPropertySource function creates a new EnvPropertySource.
67func NewEnvPropertySource() *EnvPropertySource {
68 source := &EnvPropertySource{
69 variables: make(map[string]string),
70 }
71
72 variables := os.Environ()
73
74 for _, variable := range variables {
75 index := strings.Index(variable, "=")
76 source.variables[variable[:index]] = variable[index+1:]
77 }
78
79 return source
80}
81
82// Name method returns the name of the source.
83func (s *EnvPropertySource) Name() string {

Calls 1

IndexMethod · 0.80