Skip to content

Commit

Permalink
Fix option struct init
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed Feb 26, 2017
1 parent e54bc25 commit d4adbbd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cmd/minify/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ func main() {
match := ""
siteurl := ""

cssMinifier := &css.Minifier{}
htmlMinifier := &html.Minifier{}
jsMinifier := &js.Minifier{}
jsonMinifier := &json.Minifier{}
svgMinifier := &svg.Minifier{}
xmlMinifier := &xml.Minifier{}

flag.Usage = func() {
Expand Down Expand Up @@ -167,11 +171,11 @@ func main() {
}

m = min.New()
m.AddFunc("text/css", css.Minify)
m.Add("text/css", cssMinifier)
m.Add("text/html", htmlMinifier)
m.AddFunc("text/javascript", js.Minify)
m.AddFunc("image/svg+xml", svg.Minify)
m.AddFuncRegexp(regexp.MustCompile("[/+]json$"), json.Minify)
m.Add("text/javascript", jsMinifier)
m.Add("image/svg+xml", svgMinifier)
m.AddRegexp(regexp.MustCompile("[/+]json$"), jsonMinifier)
m.AddRegexp(regexp.MustCompile("[/+]xml$"), xmlMinifier)

if m.URL, err = url.Parse(siteurl); err != nil {
Expand Down

0 comments on commit d4adbbd

Please sign in to comment.