Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
denisvmedia committed Sep 23, 2023
1 parent d961ed3 commit 10b91e1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions testdata/enforce-slice-style-make.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package fixtures
func somefn() {
m0 := make([]string, 10)
m1 := make([]string, 0, 10)
m2 := make([]string)
m3 := []string{} // MATCH /use make([]type) instead of []type{}/
m2 := make([]string, 0)
m3 := []string{} // MATCH /use make([]type) instead of []type{} (or declare nil slice)/
m4 := []string{"v1", "v2"}
m5 := [8]string{}
m6 := [...]string{}
Expand All @@ -23,8 +23,8 @@ type Slice []string
func somefn2() {
m0 := make(Slice, 10)
m1 := make(Slice, 0, 10)
m2 := make(Slice)
m3 := Slice{} // MATCH /use make([]type) instead of []type{}/
m2 := make(Slice, 0)
m3 := Slice{} // MATCH /use make([]type) instead of []type{} (or declare nil slice)/
m4 := Slice{"v1", "v2"}

_ = m0
Expand All @@ -39,8 +39,8 @@ type SliceSlice Slice
func somefn3() {
m0 := make(SliceSlice, 10)
m1 := make(SliceSlice, 0, 10)
m2 := make(SliceSlice)
m3 := SliceSlice{} // MATCH /use make([]type) instead of []type{}/
m2 := make(SliceSlice, 0)
m3 := SliceSlice{} // MATCH /use make([]type) instead of []type{} (or declare nil slice)/
m4 := SliceSlice{"v1", "v2"}

_ = m0
Expand All @@ -51,11 +51,11 @@ func somefn3() {
}

func somefn4() {
m1 := [][]string{} // MATCH /use make([]type) instead of []type{}/
m1 := [][]string{} // MATCH /use make([]type) instead of []type{} (or declare nil slice)/
m1["el0"] = make([]string, 10)
m1["el1"] = make([]string, 0, 10)
m1["el2"] = make([]string)
m1["el3"] = []string{} // MATCH /use make([]type) instead of []type{}/
m1["el2"] = make([]string, 0)
m1["el3"] = []string{} // MATCH /use make([]type) instead of []type{} (or declare nil slice)/
m1["el4"] = []string{"v1", "v2"}

_ = m1
Expand Down

0 comments on commit 10b91e1

Please sign in to comment.