toConfigEntry is a helper function to convert a string value to a ConfigEntry with a given source. It's a bit of FP style but it allows us to map an Option[string] to Option[gh.ConfigEntry] without unwrapping the it and rewrapping it.
(source gh.ConfigSource)
| 94 | // It's a bit of FP style but it allows us to map an Option[string] to Option[gh.ConfigEntry] without |
| 95 | // unwrapping the it and rewrapping it. |
| 96 | func toConfigEntry(source gh.ConfigSource) func(val string) gh.ConfigEntry { |
| 97 | return func(val string) gh.ConfigEntry { |
| 98 | return gh.ConfigEntry{Value: val, Source: source} |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | func (c *cfg) Set(hostname, key, value string) { |
| 103 | if hostname == "" { |