We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents aa4daa2 + 2027caf commit e735d05Copy full SHA for e735d05
kafka/config.go
@@ -71,25 +71,21 @@ func (m ConfigMap) Set(kv string) error {
71
return m.SetKey(k, v)
72
}
73
74
-type stringable interface {
75
- String() string
76
-}
77
-
78
func value2string(v ConfigValue) (ret string, errstr string) {
79
80
- switch v.(type) {
+ switch x := v.(type) {
81
case bool:
82
- if v.(bool) {
+ if x {
83
ret = "true"
84
} else {
85
ret = "false"
86
87
case int:
88
- ret = fmt.Sprintf("%d", v)
+ ret = fmt.Sprintf("%d", x)
89
case string:
90
- ret = v.(string)
91
- case stringable:
92
- ret = v.(stringable).String()
+ ret = x
+ case fmt.Stringer:
+ ret = x.String()
93
default:
94
return "", fmt.Sprintf("Invalid value type %T", v)
95
0 commit comments