Commit a9058bcd authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix URLFlag

Conflicts:
	main.go
parent 8de2206c
...@@ -82,7 +82,7 @@ func main() { ...@@ -82,7 +82,7 @@ func main() {
} }
up := upstream.NewUpstream( up := upstream.NewUpstream(
authBackend, *authBackend,
*authSocket, *authSocket,
Version, Version,
*documentRoot, *documentRoot,
......
...@@ -5,7 +5,9 @@ import ( ...@@ -5,7 +5,9 @@ import (
"net/url" "net/url"
) )
type urlFlag struct{ *url.URL } type urlFlag struct {
*url.URL
}
func (u *urlFlag) Set(s string) error { func (u *urlFlag) Set(s string) error {
myURL, err := url.Parse(s) myURL, err := url.Parse(s)
...@@ -16,8 +18,8 @@ func (u *urlFlag) Set(s string) error { ...@@ -16,8 +18,8 @@ func (u *urlFlag) Set(s string) error {
return nil return nil
} }
func URLFlag(name string, value *url.URL, usage string) *url.URL { func URLFlag(name string, value *url.URL, usage string) **url.URL {
f := urlFlag{value} f := &urlFlag{value}
flag.CommandLine.Var(&f, name, usage) flag.CommandLine.Var(f, name, usage)
return f.URL return &f.URL
} }
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