NewConfigFromText create an empty configuration representation from text.
(text string)
| 64 | |
| 65 | // NewConfigFromText create an empty configuration representation from text. |
| 66 | func NewConfigFromText(text string) (ConfigInterface, error) { |
| 67 | c := &Config{ |
| 68 | data: make(map[string]map[string]string), |
| 69 | } |
| 70 | err := c.parseBuffer(bufio.NewReader(strings.NewReader(text))) |
| 71 | return c, err |
| 72 | } |
| 73 | |
| 74 | // AddConfig adds a new section->key:value to the configuration. |
| 75 | func (c *Config) AddConfig(section string, option string, value string) bool { |
no test coverage detected
searching dependent graphs…