diff --git a/src/os/signal/signal_unix.go b/src/os/signal/signal_unix.go index cd1111cab41..e7d2ed991d9 100644 --- a/src/os/signal/signal_unix.go +++ b/src/os/signal/signal_unix.go @@ -48,11 +48,11 @@ func signum(sig os.Signal) int { // as they might be defined in external packages like golang.org/x/sys. // Since we cannot import those platform-specific signal types, // reflection allows us to handle them in a generic way. - kind := reflect.TypeOf(sig).Kind() - switch kind { + v := reflect.ValueOf(sig) + switch v.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: // Extract the integer value from sig and validate it. - i := int(reflect.ValueOf(sig).Int()) + i := int(v.Int()) if i < 0 || i >= numSig { return -1 }