Repository navigation
Expand file tree
/
Copy pathmain.go
More file actions
80 lines (79 loc) · 1.56 KB
/
Copy pathmain.go
File metadata and controls
80 lines (79 loc) · 1.56 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package main
//
//import (
// "fmt"
// "os"
// "strings"
//)
//
//const NEVER_USED = "should fail"
//
//func main() {
// if err := testErrorFormat(); err != nil {
// // printf: Errorf call has arguments but no formatting directives (govet)
// fmt.Errorf("error", err)
//
// // Solution
// fmt.Errorf("error %v:", err)
//
// }
//}
//
//func testErrorFormat() error {
// return os.Chdir("test")
//}
//
//// The following will fail with (golint)
//
//type AppService struct {
// Name string
//}
//
//// Should fail with GoSimple
//func (s *AppService) validateContent() bool {
// if strings.Count(s.Name, " ") > 4 {
// return false
// }
// return true
//}
//
//// Should fail with GoSimple
//func (s *AppService) validateContent2() bool {
// return strings.Count(s.Name, " ") > 4
//}
//
//// The following wil fail with (golint) (deadcode)
//// Should
//type AppServiceCommentStyle struct {
// Name string
//}
//
//// The following will fail with (structcheck)
//// NotOPtime
//type NotOPtime struct {
// Name string
// value bool
// Number int
//}
//
//// The following will fail with (maligned)
//// NotOptimesed is an test to check lint issues
//type NotOptimesed struct {
// Check bool
// Mapped []string
// Value bool
// Number int
// Name string
//}
//
//func (f *NotOptimesed) testUseNotOptimesed() error {
// return nil
//}
//
// nolint:lll
//func(f *NotOptimesed) pleaseLetCheckYourCode(value string) string {
// if f.Name == "test" && f.Value == true && len(value) > 0 && value == "i will write something big here just to show it failing" {
// return "worked"
// }
// return "fail"
//}