1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-27 22:18:41 +02:00

refactor: rename files to follow Go convention

This commit is contained in:
Oleksandr Redko
2024-11-11 13:39:10 +02:00
committed by chavacava
parent c0d4d07ab6
commit be95bfa705
299 changed files with 181 additions and 178 deletions

51
testdata/enforce_map_style_make.go vendored Normal file
View File

@@ -0,0 +1,51 @@
package fixtures
func somefn() {
m0 := make(map[string]string, 10)
m1 := make(map[string]string)
m2 := map[string]string{} // MATCH /use make(map[type]type) instead of map[type]type{}/
m3 := map[string]string{"k1": "v1", "k2": "v2"}
_ = m0
_ = m1
_ = m2
_ = m3
}
type Map map[string]string
func somefn2() {
m0 := make(Map, 10)
m1 := make(Map)
m2 := Map{} // MATCH /use make(map[type]type) instead of map[type]type{}/
m3 := Map{"k1": "v1", "k2": "v2"}
_ = m0
_ = m1
_ = m2
_ = m3
}
type MapMap Map
func somefn3() {
m0 := make(MapMap, 10)
m1 := make(MapMap)
m2 := MapMap{} // MATCH /use make(map[type]type) instead of map[type]type{}/
m3 := MapMap{"k1": "v1", "k2": "v2"}
_ = m0
_ = m1
_ = m2
_ = m3
}
func somefn4() {
m1 := map[string]map[string]string{} // MATCH /use make(map[type]type) instead of map[type]type{}/
m1["el0"] = make(map[string]string, 10)
m1["el1"] = make(map[string]string)
m1["el2"] = map[string]string{} // MATCH /use make(map[type]type) instead of map[type]type{}/
m1["el3"] = map[string]string{"k1": "v1", "k2": "v2"}
_ = m1
}