Permalink
Browse files

PR feedback - map -> array, camel case fix.

  • Loading branch information...
elementalvoid committed Apr 4, 2016
1 parent ce91a61 commit 0c999960a8124392b9001ae88a73679f2f413f1c
Showing with 4 additions and 5 deletions.
  1. +4 −5 server.go
View
@@ -21,12 +21,11 @@ func fallback(w http.ResponseWriter, r *http.Request, reason string) {
}
func getRedirect(txt []string, url string) (*Redirect, error) {
- catch_alls := make(map[string]*Config)
-
+ var catchAlls []*Config
for _, record := range txt {
config := Parse(record)
- if strings.TrimSpace(config.From) == "" {
- catch_alls[record] = config
+ if config.From == "" {
+ catchAlls = append(catchAlls, config)
continue
}
redirect := Translate(url, config)
@@ -36,7 +35,7 @@ func getRedirect(txt []string, url string) (*Redirect, error) {
}
var config *Config
- for _, config = range catch_alls {
+ for _, config = range catchAlls {
redirect := Translate(url, config)
if redirect != nil {
return redirect, nil

0 comments on commit 0c99996

Please sign in to comment.