Skip to content

Commit

Permalink
CR update
Browse files Browse the repository at this point in the history
  • Loading branch information
cce committed May 30, 2023
1 parent 81c8461 commit 08f7542
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cmd/netgoal/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,22 @@ var networkBuildCmd = &cobra.Command{
},
}

func runBuildNetwork() (err error) {
func runBuildNetwork() error {
if cpuprofilePath != "" {
f, osErr := os.Create(cpuprofilePath)
if osErr != nil {
log.Fatalf("%s: could not create CPU profile, %v", cpuprofilePath, osErr)
f, err := os.Create(cpuprofilePath)
if err != nil {
log.Fatalf("%s: could not create CPU profile, %v", cpuprofilePath, err)
}
defer f.Close() // error handling omitted for example
if ppErr := pprof.StartCPUProfile(f); ppErr != nil {
log.Fatalf("%s: could not start CPU profile, %v", cpuprofilePath, ppErr)
if err := pprof.StartCPUProfile(f); err != nil {
log.Fatalf("%s: could not start CPU profile, %v", cpuprofilePath, err)
}
defer pprof.StopCPUProfile()
}

networkRootDir, err := filepath.Abs(networkRootDir)
if err != nil {
return
return err
}
// Make sure target directory doesn't already exist
exists := util.FileExists(networkRootDir)
Expand All @@ -109,7 +109,7 @@ func runBuildNetwork() (err error) {
}

if networkRecipeFile, err = filepath.Abs(networkRecipeFile); err != nil {
return
return err
}

var r recipe
Expand Down

0 comments on commit 08f7542

Please sign in to comment.