From 80db177f5a20d95e179e7e46b834dc6d5c974238 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Thu, 10 Sep 2015 19:57:23 -0700 Subject: [PATCH] Fix vet warnings about unkeyed fields Signed-off-by: Alexander Morozov --- config/setup/gzip.go | 4 ++-- config/setup/rewrite_test.go | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/setup/gzip.go b/config/setup/gzip.go index e78d374a..a81c5f17 100644 --- a/config/setup/gzip.go +++ b/config/setup/gzip.go @@ -27,8 +27,8 @@ func gzipParse(c *Controller) ([]gzip.Config, error) { for c.Next() { config := gzip.Config{} - pathFilter := gzip.PathFilter{make(gzip.Set)} - extFilter := gzip.ExtFilter{make(gzip.Set)} + pathFilter := gzip.PathFilter{IgnoredPaths: make(gzip.Set)} + extFilter := gzip.ExtFilter{Exts: make(gzip.Set)} // No extra args expected if len(c.RemainingArgs()) > 0 { diff --git a/config/setup/rewrite_test.go b/config/setup/rewrite_test.go index 6ce8d97e..f5426678 100644 --- a/config/setup/rewrite_test.go +++ b/config/setup/rewrite_test.go @@ -42,17 +42,17 @@ func TestRewriteParse(t *testing.T) { expected []rewrite.Rule }{ {`rewrite /from /to`, false, []rewrite.Rule{ - rewrite.SimpleRule{"/from", "/to"}, + rewrite.SimpleRule{From: "/from", To: "/to"}, }}, {`rewrite /from /to rewrite a b`, false, []rewrite.Rule{ - rewrite.SimpleRule{"/from", "/to"}, - rewrite.SimpleRule{"a", "b"}, + rewrite.SimpleRule{From: "/from", To: "/to"}, + rewrite.SimpleRule{From: "a", To: "b"}, }}, {`rewrite a`, true, []rewrite.Rule{}}, {`rewrite`, true, []rewrite.Rule{}}, {`rewrite a b c`, true, []rewrite.Rule{ - rewrite.SimpleRule{"a", "b"}, + rewrite.SimpleRule{From: "a", To: "b"}, }}, } @@ -98,14 +98,14 @@ func TestRewriteParse(t *testing.T) { r .* to /to }`, false, []rewrite.Rule{ - &rewrite.RegexpRule{"/", "/to", nil, regexp.MustCompile(".*")}, + &rewrite.RegexpRule{Base: "/", To: "/to", Regexp: regexp.MustCompile(".*")}, }}, {`rewrite { regexp .* to /to ext / html txt }`, false, []rewrite.Rule{ - &rewrite.RegexpRule{"/", "/to", []string{"/", "html", "txt"}, regexp.MustCompile(".*")}, + &rewrite.RegexpRule{Base: "/", To: "/to", Exts: []string{"/", "html", "txt"}, Regexp: regexp.MustCompile(".*")}, }}, {`rewrite /path { r rr @@ -116,8 +116,8 @@ func TestRewriteParse(t *testing.T) { to /to } `, false, []rewrite.Rule{ - &rewrite.RegexpRule{"/path", "/dest", nil, regexp.MustCompile("rr")}, - &rewrite.RegexpRule{"/", "/to", nil, regexp.MustCompile("[a-z]+")}, + &rewrite.RegexpRule{Base: "/path", To: "/dest", Regexp: regexp.MustCompile("rr")}, + &rewrite.RegexpRule{Base: "/", To: "/to", Regexp: regexp.MustCompile("[a-z]+")}, }}, {`rewrite { to /to