File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ func (o *sshConfigOptions) addOption(option string) error {
75
75
if err != nil {
76
76
return err
77
77
}
78
- if o .removedKeys != nil && o .removedKeys [key ] {
78
+ if o .removedKeys != nil && o .removedKeys [strings . ToLower ( key ) ] {
79
79
// Key marked as removed, skip.
80
80
return nil
81
81
}
@@ -87,7 +87,7 @@ func (o *sshConfigOptions) addOption(option string) error {
87
87
if o .removedKeys == nil {
88
88
o .removedKeys = make (map [string ]bool )
89
89
}
90
- o .removedKeys [key ] = true
90
+ o .removedKeys [strings . ToLower ( key ) ] = true
91
91
}
92
92
return nil
93
93
}
Original file line number Diff line number Diff line change @@ -272,32 +272,32 @@ func Test_sshConfigOptions_addOption(t *testing.T) {
272
272
},
273
273
},
274
274
{
275
- Name : "Replace " ,
275
+ Name : "AddTwo " ,
276
276
Start : []string {
277
277
"foo bar" ,
278
278
},
279
279
Add : []string {"Foo baz" },
280
280
Expect : []string {
281
+ "foo bar" ,
281
282
"Foo baz" ,
282
283
},
283
284
},
284
285
{
285
- Name : "AddAndReplace " ,
286
+ Name : "AddAndRemove " ,
286
287
Start : []string {
287
- "a b" ,
288
288
"foo bar" ,
289
289
"buzz bazz" ,
290
290
},
291
291
Add : []string {
292
292
"b c" ,
293
+ "a=" , // Remove all entries that start with "a", i.e. next line.
293
294
"A hello" ,
294
295
"hello world" ,
295
296
},
296
297
Expect : []string {
297
298
"foo bar" ,
298
299
"buzz bazz" ,
299
300
"b c" ,
300
- "A hello" ,
301
301
"hello world" ,
302
302
},
303
303
},
You can’t perform that action at this time.
0 commit comments