-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10b91e1
commit 256eccd
Showing
1 changed file
with
50 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,62 @@ | ||
package fixtures | ||
|
||
func somefn() { | ||
m1 := make([]string) | ||
m2 := []string{} | ||
m3 := make([]string, 10) | ||
m4 := make([]string, 0, 10) | ||
m5 := []string{"v1"} | ||
m0 := make([]string, 10) | ||
m1 := make([]string, 0, 10) | ||
m2 := make([]string, 0) | ||
m3 := []string{} | ||
m4 := []string{"v1", "v2"} | ||
m5 := [8]string{} | ||
m6 := [...]string{} | ||
m7 := [...]string{"v1"} | ||
m8 := [1]string{"v1"} | ||
|
||
_ = m0 | ||
_ = m1 | ||
_ = m2 | ||
_ = m3 | ||
_ = m4 | ||
_ = m5 | ||
_ = m6 | ||
_ = m7 | ||
_ = m8 | ||
} | ||
|
||
type Slice []string | ||
|
||
func somefn2() { | ||
m0 := make(Slice, 10) | ||
m1 := make(Slice, 0, 10) | ||
m2 := make(Slice, 0) | ||
m3 := Slice{} | ||
m4 := Slice{"v1", "v2"} | ||
|
||
_ = m0 | ||
_ = m1 | ||
_ = m2 | ||
_ = m3 | ||
_ = m4 | ||
} | ||
|
||
type SliceSlice Slice | ||
|
||
func somefn3() { | ||
m0 := make(SliceSlice, 10) | ||
m1 := make(SliceSlice, 0, 10) | ||
m2 := make(SliceSlice, 0) | ||
m3 := SliceSlice{} | ||
m4 := SliceSlice{"v1", "v2"} | ||
|
||
_ = m0 | ||
_ = m1 | ||
_ = m2 | ||
_ = m3 | ||
_ = m4 | ||
} | ||
|
||
func somefn4() { | ||
m1 := [][]string{} | ||
m1["el0"] = make([]string, 10) | ||
m1["el1"] = make([]string, 0, 10) | ||
m1["el2"] = make([]string, 0) | ||
m1["el3"] = []string{} | ||
m1["el4"] = []string{"v1", "v2"} | ||
|
||
_ = m1 | ||
} |