Skip to content

Commit

Permalink
Removed some error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
prehensilecode committed Jun 15, 2021
1 parent bd7d3bd commit 3e59562
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions slurm_billing_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func execute(account string, year int, month int) {
out, err := exec.Command("sreport", cmd_options...).Output()

if err != nil {
fmt.Printf("%s", err)
panic(err)
}

Expand All @@ -48,11 +47,7 @@ func execute(account string, year int, month int) {
fmt.Printf("Rate = $ %.4f per SU\n\n", rate)

outstr := strings.Split(string(out[:]), "\n")
tre, err := strconv.ParseFloat(strings.Split(outstr[0], "|")[5], 64)
if err != nil {
fmt.Printf("%s", err)
panic(err)
}
tre, _ := strconv.ParseFloat(strings.Split(outstr[0], "|")[5], 64)
su := tre / 60.

charge := su * rate
Expand All @@ -71,11 +66,7 @@ func execute(account string, year int, month int) {
line := strings.Split(s, "|")
name := line[3]
login := line[2]
tre, err := strconv.ParseFloat(line[5], 65)
if err != nil {
fmt.Printf("%s", err)
panic(err)
}
tre, _ := strconv.ParseFloat(line[5], 65)
su := tre / 60.
charge_str := p.Sprintf("%.2f", su * rate)
fmt.Printf("%20s %8s %8.6e $ %9s\n", name, login, su, charge_str)
Expand Down

0 comments on commit 3e59562

Please sign in to comment.