control/controlclient: fix build break caused by overzealous gitting

reviewable/pr331/r1
Brad Fitzpatrick 5 years ago
parent 2244cca5ff
commit a464439658

@ -16,6 +16,7 @@ import (
"io/ioutil" "io/ioutil"
"log" "log"
"net/http" "net/http"
"net/url"
"os" "os"
"reflect" "reflect"
"strconv" "strconv"
@ -115,6 +116,10 @@ func NewDirect(opts Options) (*Direct, error) {
return nil, errors.New("controlclient.New: no server URL specified") return nil, errors.New("controlclient.New: no server URL specified")
} }
opts.ServerURL = strings.TrimRight(opts.ServerURL, "/") opts.ServerURL = strings.TrimRight(opts.ServerURL, "/")
serverURL, err := url.Parse(opts.ServerURL)
if err != nil {
return nil, err
}
if opts.TimeNow == nil { if opts.TimeNow == nil {
opts.TimeNow = time.Now opts.TimeNow = time.Now
} }

Loading…
Cancel
Save