@@ -78,13 +78,14 @@ func main() {
78
78
}
79
79
80
80
// Validate the host.
81
+ const fatalFmt = "%s: %s"
81
82
if * host == "" {
82
- log .Fatalf ("%s: %s" , os .Args [0 ], "--host must be present" )
83
+ log .Fatalf (fatalFmt , os .Args [0 ], "--host must be present" )
83
84
} else if strings .HasPrefix (* host , "http://localhost" ) {
84
85
fmt .Fprintf (os .Stderr , "Using developer host %s\n " , * host )
85
86
} else if ! strings .HasPrefix (* host , "https://" ) {
86
87
// Refuse to call APIs over anything but https://
87
- log .Fatalf ("%s: %s" , os .Args [0 ], "--host must start with https://" )
88
+ log .Fatalf (fatalFmt , os .Args [0 ], "--host must start with https://" )
88
89
}
89
90
90
91
// Trim a trailing slash.
@@ -96,7 +97,7 @@ func main() {
96
97
fmt .Printf ("Using developer api-host %s\n " , * apiHost )
97
98
} else if ! strings .HasPrefix (* apiHost , "https://" ) {
98
99
// Refuse to call APIs over anything but https://
99
- log .Fatalf ("%s: %s" , os .Args [0 ], "--api-host must start with https://" )
100
+ log .Fatalf (fatalFmt , os .Args [0 ], "--api-host must start with https://" )
100
101
}
101
102
// Trim a trailing slash.
102
103
* apiHost = strings .TrimSuffix (* apiHost , "/" )
0 commit comments