int/version: fix forcetypeassert linter warning
internal/version/version.go:175:4: type assertion must be checked (forcetypeassert)
valueString = strings.Join(value.Interface().([]string), ", ")
^
@@ -172,7 +172,10 @@ func (i *Info) String() string {
valueString = fmt.Sprint(value.Bool())
case reflect.Slice:
- valueString = strings.Join(value.Interface().([]string), ", ")
+ // Only expecting []string here; ignore other slices.
+ if s, ok := value.Interface().([]string); ok {
+ valueString = strings.Join(s, ", ")
+ }
case reflect.String:
valueString = value.String()
