Skip to content

Commit e1e1895

Browse files
elboulangerojbkempf
authored andcommitted
config: Remove copy of isInSlice
Now that we import `utils` in `config` (cf. previous commits), we can use `IsInSlice` from `utils.go`, no need to duplicate it anymore.
1 parent f23fc1c commit e1e1895

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

config/config.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func ReloadConfig() error {
163163
if c.WeightDistributionRange <= 0 {
164164
return fmt.Errorf("WeightDistributionRange must be > 0")
165165
}
166-
if !isInSlice(c.OutputMode, []string{"auto", "json", "redirect"}) {
166+
if !utils.IsInSlice(c.OutputMode, []string{"auto", "json", "redirect"}) {
167167
return fmt.Errorf("Config: outputMode can only be set to 'auto', 'json' or 'redirect'")
168168
}
169169
if c.Repository == "" {
@@ -266,13 +266,3 @@ func testSentinelsEq(a, b []sentinels) bool {
266266

267267
return true
268268
}
269-
270-
//DUPLICATE
271-
func isInSlice(a string, list []string) bool {
272-
for _, b := range list {
273-
if b == a {
274-
return true
275-
}
276-
}
277-
return false
278-
}

0 commit comments

Comments
 (0)