mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Merge pull request #86874 from php-coder/patch-1
kubetestgen: improve errors handling
This commit is contained in:
commit
ca70efd741
@ -131,6 +131,7 @@ func printYAML(fileName string, areaO Area) {
|
||||
f, err := os.Create(fileName + ".yaml")
|
||||
if err != nil {
|
||||
fmt.Printf("ERROR: %s\n", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
defer f.Close()
|
||||
y, err := yaml.Marshal(areaO)
|
||||
@ -139,7 +140,11 @@ func printYAML(fileName string, areaO Area) {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
f.WriteString(string(y))
|
||||
_, err = f.WriteString(string(y))
|
||||
if err != nil {
|
||||
fmt.Printf("ERROR: %s\n", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func countFields(suites []Suite) {
|
||||
|
Loading…
Reference in New Issue
Block a user