NewEnvPropertySource function creates a new EnvPropertySource.
()
| 65 | |
| 66 | // NewEnvPropertySource function creates a new EnvPropertySource. |
| 67 | func 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. |
| 83 | func (s *EnvPropertySource) Name() string { |