File tree Expand file tree Collapse file tree 5 files changed +5
-6
lines changed Expand file tree Collapse file tree 5 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 3
3
# TODO remove this rule.
4
4
disable :
5
5
- errcheck
6
- - gosimple
7
6
- ineffassign
8
7
- staticcheck
9
8
linters-settings :
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ func (c statusChecker) MakeCommandArgs() []string {
29
29
30
30
func (c statusChecker ) Parse (out string ) (checkers.Status , string ) {
31
31
lines := strings .Split (out , "\n " )
32
- errors := make ([]string , 0 , 0 )
32
+ errors := make ([]string , 0 )
33
33
34
34
for _ , line := range lines {
35
35
if line != "" && ! strings .Contains (line , "running(0:PING_OK)" ) {
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ func (opts *sshOpts) run() *checkers.Checker {
136
136
if err != nil {
137
137
if addrerr , ok := err .(* net.AddrError ); ok {
138
138
if addrerr .Timeout () {
139
- elapsed := time .Now (). Sub (start )
139
+ elapsed := time .Since (start )
140
140
return opts .checkTimeoutError (elapsed , err )
141
141
} else if addrerr .Temporary () {
142
142
return checkers .Warning (err .Error ())
@@ -152,7 +152,7 @@ func (opts *sshOpts) run() *checkers.Checker {
152
152
if err != nil {
153
153
return checkers .Unknown (err .Error ())
154
154
}
155
- elapsed := time .Now (). Sub (start )
155
+ elapsed := time .Since (start )
156
156
return opts .checkTimeout (elapsed )
157
157
}
158
158
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ func Run(args []string) *checkers.Checker {
47
47
return checkers .Critical (err .Error ())
48
48
}
49
49
expiry := cert .NotAfter
50
- dur := expiry . Sub ( time .Now () )
50
+ dur := time .Until ( expiry )
51
51
52
52
chkSt := checkers .OK
53
53
days := int (dur .Hours () / 24 )
Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ func (opts *tcpOpts) run() *checkers.Checker {
223
223
return checkers .Critical (err .Error ())
224
224
}
225
225
}
226
- elapsedSeconds := float64 (time .Now (). Sub (start )) / float64 (time .Second )
226
+ elapsedSeconds := float64 (time .Since (start )) / float64 (time .Second )
227
227
228
228
chkSt := checkers .OK
229
229
if opts .Warning > 0 && elapsedSeconds > opts .Warning {
You can’t perform that action at this time.
0 commit comments