(option string)
| 74 | } |
| 75 | |
| 76 | func (o *sshConfigOptions) addOption(option string) error { |
| 77 | key, value, err := codersdk.ParseSSHConfigOption(option) |
| 78 | if err != nil { |
| 79 | return err |
| 80 | } |
| 81 | lowerKey := strings.ToLower(key) |
| 82 | if o.removedKeys != nil && o.removedKeys[lowerKey] { |
| 83 | // Key marked as removed, skip. |
| 84 | return nil |
| 85 | } |
| 86 | // Only append the option if it is not empty |
| 87 | // (we interpret empty as removal). |
| 88 | if value != "" { |
| 89 | o.sshOptions = append(o.sshOptions, option) |
| 90 | } else { |
| 91 | if o.removedKeys == nil { |
| 92 | o.removedKeys = make(map[string]bool) |
| 93 | } |
| 94 | o.removedKeys[lowerKey] = true |
| 95 | } |
| 96 | return nil |
| 97 | } |
| 98 | |
| 99 | func (o sshConfigOptions) equal(other sshConfigOptions) bool { |
| 100 | if !slicesSortedEqual(o.sshOptions, other.sshOptions) { |
no test coverage detected