forked from golangci/golangci-lint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfuncorder.go
40 lines (30 loc) · 771 Bytes
/
funcorder.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//golangcitest:args -Efuncorder
package testdata
import "time"
type MyStruct struct {
Name string
}
func (m MyStruct) lenName() int { // want `unexported method "lenName" for struct "MyStruct" should be placed after the exported method "SetName"`
return len(m.Name)
}
func (m MyStruct) GetName() string {
return m.Name
}
func (m *MyStruct) SetName(name string) {
m.Name = name
}
type MyStruct2 struct {
Name string
}
func (m MyStruct2) GetName() string {
return m.Name
}
func (m *MyStruct2) SetName(name string) {
m.Name = name
}
func NewMyStruct2() *MyStruct2 { // want `constructor "NewMyStruct2" for struct "MyStruct2" should be placed before struct method "GetName"`
return &MyStruct2{Name: "John"}
}
func NewTime() time.Time {
return time.Now()
}