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)
| 85 | // It's a bit of FP style but it allows us to map an Option[string] to Option[gh.ConfigEntry] without |
| 86 | // unwrapping the it and rewrapping it. |
| 87 | func toConfigEntry(source gh.ConfigSource) func(val string) gh.ConfigEntry { |
| 88 | return func(val string) gh.ConfigEntry { |
| 89 | return gh.ConfigEntry{Value: val, Source: source} |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | func (c *cfg) Set(hostname, key, value string) { |
| 94 | if hostname == "" { |