Commit a9058bcd authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix URLFlag

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