Skip to content

Commit 602788d

Browse files
committed
DUPLO-13771 Fix SonarQube PR issue 1/2
1 parent 5e03dfc commit 602788d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cmd/duplo-jit/main.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,14 @@ func main() {
7878
}
7979

8080
// Validate the host.
81+
const fatalFmt = "%s: %s"
8182
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")
8384
} else if strings.HasPrefix(*host, "http://localhost") {
8485
fmt.Fprintf(os.Stderr, "Using developer host %s\n", *host)
8586
} else if !strings.HasPrefix(*host, "https://") {
8687
// 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://")
8889
}
8990

9091
// Trim a trailing slash.
@@ -96,7 +97,7 @@ func main() {
9697
fmt.Printf("Using developer api-host %s\n", *apiHost)
9798
} else if !strings.HasPrefix(*apiHost, "https://") {
9899
// 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://")
100101
}
101102
// Trim a trailing slash.
102103
*apiHost = strings.TrimSuffix(*apiHost, "/")

0 commit comments

Comments
 (0)