Skip to content

Commit 2942835

Browse files
committed
vet: log/logger.go
1 parent cbc4a85 commit 2942835

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

intra/log/logger.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import (
3636
"fmt"
3737
golog "log"
3838
"os"
39-
"reflect"
4039
"runtime"
4140
"strings"
4241
"sync"
@@ -412,26 +411,3 @@ func (l *simpleLogger) err(at int, msg string) {
412411
_ = l.e.Output(at, msg) // may error
413412
l.q.Push(msg)
414413
}
415-
416-
// from: core/closer.go
417-
418-
func isNotNil(x any) bool {
419-
return !isNil(x)
420-
}
421-
422-
// isNil reports whether x is nil if its Chan, Func, Map,
423-
// Pointer, UnsafePointer, Interface, and Slice;
424-
// may panic if x is not addressable
425-
func isNil(x any) bool {
426-
// from: stackoverflow.com/a/76595928
427-
if x == nil {
428-
return true
429-
}
430-
v := reflect.ValueOf(x)
431-
k := v.Kind()
432-
switch k {
433-
case reflect.Pointer, reflect.UnsafePointer, reflect.Interface, reflect.Chan, reflect.Func, reflect.Map, reflect.Slice:
434-
return v.IsNil()
435-
}
436-
return false
437-
}

0 commit comments

Comments
 (0)