Skip to content

Commit 871ec84

Browse files
committed
parse the endpoint into a URL up front, and gather the proxy from the env up front so that typos and malformed urls will surface immediately
1 parent b9c114a commit 871ec84

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

cmd/src/main.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"encoding/json"
66
"flag"
7+
"fmt"
78
"io"
89
"log"
910
"net"
@@ -185,7 +186,8 @@ func (c *config) apiClient(flags *api.Flags, out io.Writer) api.Client {
185186
return api.NewClient(opts)
186187
}
187188

188-
// readConfig reads the config file from the given path.
189+
// readConfig reads the config from the standard config file, the (deprecated) user-specified config file,
190+
// the environment variables, and the (deprecated) command-line flags.
189191
func readConfig() (*config, error) {
190192
cfgFile := *configPath
191193
userSpecified := *configPath != ""
@@ -298,7 +300,7 @@ func readConfig() (*config, error) {
298300
return nil, errors.Newf("invalid proxy configuration: %w", err)
299301
}
300302
if !isValidUDS {
301-
return nil, errors.Newf("invalid proxy socket: %s", path)
303+
return nil, errors.Newf("Invalid proxy socket: %s", path)
302304
}
303305
cfg.proxyPath = path
304306
} else {

0 commit comments

Comments
 (0)