mirror of
https://github.com/samber/lo.git
synced 2025-09-26 20:11:13 +08:00
style(lint): forcetypeassert
This commit is contained in:
@@ -25,7 +25,7 @@ func messageFromMsgAndArgs(msgAndArgs ...any) string {
|
||||
return fmt.Sprintf("%+v", msgAndArgs[0])
|
||||
}
|
||||
if len(msgAndArgs) > 1 {
|
||||
return fmt.Sprintf(msgAndArgs[0].(string), msgAndArgs[1:]...) //nolint:errcheck
|
||||
return fmt.Sprintf(msgAndArgs[0].(string), msgAndArgs[1:]...) //nolint:errcheck,forcetypeassert
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
@@ -106,7 +106,7 @@ func FromAnySlice[T any](in []any) (out []T, ok bool) {
|
||||
|
||||
result := make([]T, len(in))
|
||||
for i := range in {
|
||||
result[i] = in[i].(T) //nolint:errcheck
|
||||
result[i] = in[i].(T) //nolint:errcheck,forcetypeassert
|
||||
}
|
||||
return result, true
|
||||
}
|
||||
|
Reference in New Issue
Block a user