Commit 80db177f authored by Alexander Morozov's avatar Alexander Morozov

Fix vet warnings about unkeyed fields

Signed-off-by: default avatarAlexander Morozov <lk4d4@docker.com>
parent 3d1cac31
...@@ -27,8 +27,8 @@ func gzipParse(c *Controller) ([]gzip.Config, error) { ...@@ -27,8 +27,8 @@ func gzipParse(c *Controller) ([]gzip.Config, error) {
for c.Next() { for c.Next() {
config := gzip.Config{} config := gzip.Config{}
pathFilter := gzip.PathFilter{make(gzip.Set)} pathFilter := gzip.PathFilter{IgnoredPaths: make(gzip.Set)}
extFilter := gzip.ExtFilter{make(gzip.Set)} extFilter := gzip.ExtFilter{Exts: make(gzip.Set)}
// No extra args expected // No extra args expected
if len(c.RemainingArgs()) > 0 { if len(c.RemainingArgs()) > 0 {
......
...@@ -42,17 +42,17 @@ func TestRewriteParse(t *testing.T) { ...@@ -42,17 +42,17 @@ func TestRewriteParse(t *testing.T) {
expected []rewrite.Rule expected []rewrite.Rule
}{ }{
{`rewrite /from /to`, false, []rewrite.Rule{ {`rewrite /from /to`, false, []rewrite.Rule{
rewrite.SimpleRule{"/from", "/to"}, rewrite.SimpleRule{From: "/from", To: "/to"},
}}, }},
{`rewrite /from /to {`rewrite /from /to
rewrite a b`, false, []rewrite.Rule{ rewrite a b`, false, []rewrite.Rule{
rewrite.SimpleRule{"/from", "/to"}, rewrite.SimpleRule{From: "/from", To: "/to"},
rewrite.SimpleRule{"a", "b"}, rewrite.SimpleRule{From: "a", To: "b"},
}}, }},
{`rewrite a`, true, []rewrite.Rule{}}, {`rewrite a`, true, []rewrite.Rule{}},
{`rewrite`, true, []rewrite.Rule{}}, {`rewrite`, true, []rewrite.Rule{}},
{`rewrite a b c`, 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) { ...@@ -98,14 +98,14 @@ func TestRewriteParse(t *testing.T) {
r .* r .*
to /to to /to
}`, false, []rewrite.Rule{ }`, false, []rewrite.Rule{
&rewrite.RegexpRule{"/", "/to", nil, regexp.MustCompile(".*")}, &rewrite.RegexpRule{Base: "/", To: "/to", Regexp: regexp.MustCompile(".*")},
}}, }},
{`rewrite { {`rewrite {
regexp .* regexp .*
to /to to /to
ext / html txt ext / html txt
}`, false, []rewrite.Rule{ }`, 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 { {`rewrite /path {
r rr r rr
...@@ -116,8 +116,8 @@ func TestRewriteParse(t *testing.T) { ...@@ -116,8 +116,8 @@ func TestRewriteParse(t *testing.T) {
to /to to /to
} }
`, false, []rewrite.Rule{ `, false, []rewrite.Rule{
&rewrite.RegexpRule{"/path", "/dest", nil, regexp.MustCompile("rr")}, &rewrite.RegexpRule{Base: "/path", To: "/dest", Regexp: regexp.MustCompile("rr")},
&rewrite.RegexpRule{"/", "/to", nil, regexp.MustCompile("[a-z]+")}, &rewrite.RegexpRule{Base: "/", To: "/to", Regexp: regexp.MustCompile("[a-z]+")},
}}, }},
{`rewrite { {`rewrite {
to /to to /to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment