Skip to content

Commit 22e8f8f

Browse files
committed
fix: lint
1 parent 4cba9ff commit 22e8f8f

2 files changed

Lines changed: 46 additions & 7 deletions

File tree

internal/config/config_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ func TestSaveAndLoadConfig(t *testing.T) {
175175

176176
// Save config
177177
cfg.Previous = "work"
178+
178179
err := cfg.SaveConfig(configFile)
179180
if err != nil {
180181
t.Fatalf("SaveConfig failed: %v", err)

internal/config/sections_test.go

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,12 @@ func TestGetSection(t *testing.T) {
133133

134134
// Deep compare maps
135135
if len(result) != len(tt.expected) {
136-
t.Errorf("GetSection(%q) length = %d, want %d", tt.section, len(result), len(tt.expected))
136+
t.Errorf(
137+
"GetSection(%q) length = %d, want %d",
138+
tt.section,
139+
len(result),
140+
len(tt.expected),
141+
)
137142

138143
return
139144
}
@@ -150,14 +155,26 @@ func TestGetSection(t *testing.T) {
150155
if expectedMap, ok := expectedValue.(map[string]any); ok {
151156
actualMap, ok := actualValue.(map[string]any)
152157
if !ok {
153-
t.Errorf("GetSection(%q)[%q] type mismatch, got %T, want map[string]any", tt.section, key, actualValue)
158+
t.Errorf(
159+
"GetSection(%q)[%q] type mismatch, got %T, want map[string]any",
160+
tt.section,
161+
key,
162+
actualValue,
163+
)
154164

155165
continue
156166
}
157167

158168
for k, v := range expectedMap {
159169
if actualMap[k] != v {
160-
t.Errorf("GetSection(%q)[%q][%q] = %v, want %v", tt.section, key, k, actualMap[k], v)
170+
t.Errorf(
171+
"GetSection(%q)[%q][%q] = %v, want %v",
172+
tt.section,
173+
key,
174+
k,
175+
actualMap[k],
176+
v,
177+
)
161178
}
162179
}
163180
} else if actualValue != expectedValue {
@@ -212,7 +229,11 @@ func TestSetSection(t *testing.T) {
212229
// For unknown sections, result should be nil
213230
if tt.section == "unknown" {
214231
if result != nil {
215-
t.Errorf("SetSection(%q) should not set unknown section, got %v", tt.section, result)
232+
t.Errorf(
233+
"SetSection(%q) should not set unknown section, got %v",
234+
tt.section,
235+
result,
236+
)
216237
}
217238

218239
return
@@ -225,7 +246,12 @@ func TestSetSection(t *testing.T) {
225246
}
226247

227248
if len(result) != len(tt.values) {
228-
t.Errorf("SetSection(%q) length = %d, want %d", tt.section, len(result), len(tt.values))
249+
t.Errorf(
250+
"SetSection(%q) length = %d, want %d",
251+
tt.section,
252+
len(result),
253+
len(tt.values),
254+
)
229255

230256
return
231257
}
@@ -239,7 +265,13 @@ func TestSetSection(t *testing.T) {
239265
}
240266

241267
if actualValue != expectedValue {
242-
t.Errorf("SetSection(%q)[%q] = %v, want %v", tt.section, key, actualValue, expectedValue)
268+
t.Errorf(
269+
"SetSection(%q)[%q] = %v, want %v",
270+
tt.section,
271+
key,
272+
actualValue,
273+
expectedValue,
274+
)
243275
}
244276
}
245277
})
@@ -331,7 +363,13 @@ func TestGetSetSectionRoundTrip(t *testing.T) {
331363
}
332364

333365
if actualValue != expectedValue {
334-
t.Errorf("Section %q key %q = %v, want %v", section, key, actualValue, expectedValue)
366+
t.Errorf(
367+
"Section %q key %q = %v, want %v",
368+
section,
369+
key,
370+
actualValue,
371+
expectedValue,
372+
)
335373
}
336374
}
337375
})

0 commit comments

Comments
 (0)