Skip to content

Commit

Permalink
fix(anns) use nil in place of empty string slice
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Raines committed Oct 28, 2020
1 parent ad6632b commit 7b303d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/ingress/annotations/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func ExtractHostHeader(anns map[string]string) string {
func ExtractMethods(anns map[string]string) []string {
val := anns[AnnotationPrefix+MethodsKey]
if val == "" {
return []string{}
return nil
}
return strings.Split(val, ",")
}
Expand All @@ -211,7 +211,7 @@ func ExtractMethods(anns map[string]string) []string {
func ExtractSNIs(anns map[string]string) ([]string, bool) {
val, exists := anns[AnnotationPrefix+SNIsKey]
if val == "" {
return []string{}, exists
return nil, exists
}
return strings.Split(val, ","), exists
}

0 comments on commit 7b303d3

Please sign in to comment.