Skip to content

Commit 0d26b77

Browse files
committed
gofumpt
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 234f8ae commit 0d26b77

File tree

13 files changed

+16
-20
lines changed

13 files changed

+16
-20
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ linters:
1010
- errorlint
1111
- gocritic
1212
- gocyclo
13-
- gofmt
13+
- gofumpt
1414
- goimports
1515
- gomodguard
1616
- revive

interpolation/interpolation_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func TestInterpolateWithDefaults(t *testing.T) {
9898
}
9999

100100
func TestValidUnexistentInterpolation(t *testing.T) {
101-
var testcases = []struct {
101+
testcases := []struct {
102102
test string
103103
expected string
104104
errMsg string
@@ -154,7 +154,7 @@ func TestValidUnexistentInterpolation(t *testing.T) {
154154
}
155155

156156
func TestValidExistentInterpolation(t *testing.T) {
157-
var testcases = []struct {
157+
testcases := []struct {
158158
test string
159159
expected string
160160
}{
@@ -215,7 +215,7 @@ func TestInterpolateWithCast(t *testing.T) {
215215
}
216216

217217
func TestPathMatches(t *testing.T) {
218-
var testcases = []struct {
218+
testcases := []struct {
219219
doc string
220220
path tree.Path
221221
pattern tree.Path

loader/loader.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,8 @@ func loadYamlFile(ctx context.Context,
414414
environment types.Mapping,
415415
ct *cycleTracker,
416416
dict map[string]interface{},
417-
included []string) (map[string]interface{}, PostProcessor, error) {
417+
included []string,
418+
) (map[string]interface{}, PostProcessor, error) {
418419
ctx = context.WithValue(ctx, consts.ComposeFileKey{}, file.Filename)
419420
if file.Content == nil && file.Config == nil {
420421
content, err := os.ReadFile(file.Filename)

loader/loader_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1839,7 +1839,7 @@ func TestLoadInit(t *testing.T) {
18391839
booleanTrue := true
18401840
booleanFalse := false
18411841

1842-
var testcases = []struct {
1842+
testcases := []struct {
18431843
doc string
18441844
yaml string
18451845
init *bool

loader/loader_windows_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
)
2525

2626
func TestConvertWindowsVolumePath(t *testing.T) {
27-
var testcases = []struct {
27+
testcases := []struct {
2828
windowsPath string
2929
expectedConvertedPath string
3030
}{

loader/loader_yaml_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ services:
4545
image: bar
4646
command: echo world
4747
init: false
48-
`)},
48+
`),
49+
},
4950
},
5051
}, &Options{}, &cycleTracker{}, nil)
5152
assert.NilError(t, err)
@@ -85,7 +86,8 @@ configs:
8586
credentials:
8687
content: |
8788
dummy value
88-
`)},
89+
`),
90+
},
8991
},
9092
}, &Options{}, &cycleTracker{}, nil)
9193
assert.NilError(t, err)

tree/path_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
)
2525

2626
func TestPathMatches(t *testing.T) {
27-
var testcases = []struct {
27+
testcases := []struct {
2828
doc string
2929
path Path
3030
pattern Path

types/config.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ import (
2424
"github.com/go-viper/mapstructure/v2"
2525
)
2626

27-
var (
28-
// isCaseInsensitiveEnvVars is true on platforms where environment variable names are treated case-insensitively.
29-
isCaseInsensitiveEnvVars = (runtime.GOOS == "windows")
30-
)
27+
// isCaseInsensitiveEnvVars is true on platforms where environment variable names are treated case-insensitively.
28+
var isCaseInsensitiveEnvVars = (runtime.GOOS == "windows")
3129

3230
// ConfigDetails are the details about a group of ConfigFiles
3331
type ConfigDetails struct {

types/project.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,6 @@ func (p *Project) deepCopy() *Project {
746746
n := &Project{}
747747
deriveDeepCopyProject(n, p)
748748
return n
749-
750749
}
751750

752751
// WithServicesTransform applies a transformation to project services and return a new project with transformation results

types/project_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ func Test_ApplyProfiles(t *testing.T) {
4242

4343
assert.DeepEqual(t, p.ServiceNames(), []string{"service_1", "service_2", "service_4", "service_5", "service_6"})
4444
assert.DeepEqual(t, p.DisabledServiceNames(), []string{"service_3"})
45-
4645
}
4746

4847
func Test_WithoutUnnecessaryResources(t *testing.T) {

0 commit comments

Comments
 (0)