Skip to content

Commit 33b4b53

Browse files
committed
filterValue.Type(): replace a chained if statement with a switch
1 parent 6c39369 commit 33b4b53

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

internal/refopts/filter_value.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,12 @@ func (v *filterValue) String() string {
113113
}
114114

115115
func (v *filterValue) Type() string {
116-
if v.pattern != "" {
116+
switch {
117+
case v.pattern != "":
117118
return "bool"
118-
} else if v.regexp {
119+
case v.regexp:
119120
return "regexp"
120-
} else {
121+
default:
121122
return "prefix"
122123
}
123124
}

0 commit comments

Comments
 (0)