Skip to content

Commit 4aa8152

Browse files
alexshtinmeiliang86
authored andcommitted
Fix getFunctionName (#46)
1 parent 795bed8 commit 4aa8152

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/internal_worker.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,10 +1087,10 @@ func isError(inType reflect.Type) bool {
10871087
}
10881088

10891089
func getFunctionName(i interface{}) string {
1090-
fullName, ok := i.(string)
1091-
if !ok {
1092-
fullName = runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name()
1090+
if fullName, ok := i.(string); ok {
1091+
return fullName
10931092
}
1093+
fullName := runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name()
10941094
elements := strings.Split(fullName, ".")
10951095
return elements[len(elements)-1]
10961096
}

0 commit comments

Comments
 (0)