From 0d1beeb632008ef0e2696ab1d7b0df5356d54005 Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Wed, 8 Mar 2017 01:45:30 -0800 Subject: [PATCH] cmd/matchbox: fix -address parsing when built with Go 1.8 * 1.8 changed the behavior of url.Parse so it is no longer appropriate for parsing values like 0.0.0.0:8080 * Pass the address directly to http.ListenAndServe which gives reasonable errors when bad values are given --- cmd/matchbox/main.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cmd/matchbox/main.go b/cmd/matchbox/main.go index ecac9c95..e1b63986 100644 --- a/cmd/matchbox/main.go +++ b/cmd/matchbox/main.go @@ -5,7 +5,6 @@ import ( "fmt" "net" "net/http" - "net/url" "os" "github.com/Sirupsen/logrus" @@ -79,9 +78,6 @@ func main() { } // validate arguments - if url, err := url.Parse(flags.address); err != nil || url.String() == "" { - log.Fatal("A valid HTTP listen address is required") - } if finfo, err := os.Stat(flags.dataPath); err != nil || !finfo.IsDir() { log.Fatal("A valid -data-path is required") }