Skip to content

Commit 155cfe0

Browse files
authoredSep 1, 2022
chore: Use log.Fatalf instead of log.Printf and os.Exit (#2445)
1 parent 88d6374 commit 155cfe0

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed
 

‎hack/code/prices_gen.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ import (
3737
func main() {
3838
flag.Parse()
3939
if flag.NArg() != 1 {
40-
log.Printf("Usage: %s pkg/cloudprovider/aws/zz_generated.pricing.go", os.Args[0])
41-
os.Exit(1)
40+
log.Fatalf("Usage: %s pkg/cloudprovider/aws/zz_generated.pricing.go", os.Args[0])
4241
}
4342

4443
f, err := os.Create("pricing.heapprofile")

‎hack/docs/configuration_gen_docs.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ import (
2626

2727
func main() {
2828
if len(os.Args) != 2 {
29-
log.Printf("Usage: %s path/to/markdown.md", os.Args[0])
30-
os.Exit(1)
29+
log.Fatalf("Usage: %s path/to/markdown.md", os.Args[0])
3130
}
3231
outputFileName := os.Args[1]
3332
mdFile, err := os.ReadFile(outputFileName)

‎hack/docs/instancetypes_gen_docs.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ import (
4141
func main() {
4242
flag.Parse()
4343
if flag.NArg() != 1 {
44-
log.Printf("Usage: %s path/to/markdown.md", os.Args[0])
45-
os.Exit(1)
44+
log.Fatalf("Usage: %s path/to/markdown.md", os.Args[0])
4645
}
4746

4847
os.Setenv("AWS_SDK_LOAD_CONFIG", "true")

‎hack/docs/metrics_gen_docs.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ func (i metricInfo) qualifiedName() string {
4545
func main() {
4646
flag.Parse()
4747
if flag.NArg() != 2 {
48-
log.Printf("Usage: %s path/to/metrics/controller path/to/markdown.md", os.Args[0])
49-
os.Exit(1)
48+
log.Fatalf("Usage: %s path/to/metrics/controller path/to/markdown.md", os.Args[0])
5049
}
5150
fset := token.NewFileSet()
5251
var packages []*ast.Package

0 commit comments

Comments
 (0)
Please sign in to comment.