mirror of https://github.com/status-im/consul.git
Fix panic on error (#20377)
This commit is contained in:
parent
0ca7313b07
commit
a2d50af1bd
|
@ -132,7 +132,7 @@ func SingleValueFromOneOrTwoArgs[T1 any, T2 any](indexer func(value T1, optional
|
||||||
case 1:
|
case 1:
|
||||||
val, ok := args[0].(T1)
|
val, ok := args[0].(T1)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, fmt.Errorf("expected first argument type of %T, got: %T", value, args[1])
|
return nil, fmt.Errorf("expected first argument type of %T, got: %T", value, args[0])
|
||||||
}
|
}
|
||||||
value = val
|
value = val
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue