Fix vet warnings about unkeyed fields

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
Alexander Morozov 2015-09-10 19:57:23 -07:00
parent 3d1cac313c
commit 80db177f5a
2 changed files with 10 additions and 10 deletions

View File

@ -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 {

View File

@ -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) {
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) {
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