diff options
author | Nick White <git@njw.name> | 2021-07-20 11:36:35 +0100 |
---|---|---|
committer | Nick White <git@njw.name> | 2021-07-20 11:36:35 +0100 |
commit | 4773d6f74f9e31db4783dd99624a55947b21b58d (patch) | |
tree | a6d1157444565b59231576b8e266660f632e4d33 | |
parent | 315493955b2cef01681d10a1244d1025fed8d50a (diff) |
Cleanup thanks to go vet
-rw-r--r-- | cmd/getsamplepages/main.go | 2 | ||||
-rw-r--r-- | cmd/rescribe/main.go | 4 | ||||
-rw-r--r-- | graph.go | 6 |
3 files changed, 5 insertions, 7 deletions
diff --git a/cmd/getsamplepages/main.go b/cmd/getsamplepages/main.go index cb32700..bb9d0be 100644 --- a/cmd/getsamplepages/main.go +++ b/cmd/getsamplepages/main.go @@ -96,7 +96,7 @@ func main() { fn := pg + suffix err = conn.Download(conn.WIPStorageId(), p+fn, name+fn) if err != nil { - log.Fatalf("Download of %s%s failed: %v\n", p+fn, err) + log.Fatalf("Download of %s%s failed: %v\n", p, fn, err) } } } diff --git a/cmd/rescribe/main.go b/cmd/rescribe/main.go index db8eb41..251c333 100644 --- a/cmd/rescribe/main.go +++ b/cmd/rescribe/main.go @@ -228,7 +228,7 @@ These training files are included in rescribe, and are always available: abstraining, err := filepath.Abs(trainingPath) if err != nil { - log.Fatalf("Error getting absolute path of training %s: %v", err) + log.Fatalf("Error getting absolute path of training %s: %v", trainingPath, err) } tessPrefix, trainingName := filepath.Split(abstraining) trainingName = strings.TrimSuffix(trainingName, ".traineddata") @@ -499,6 +499,4 @@ func processbook(training string, tesscmd string, conn Pipeliner) error { return nil } } - - return fmt.Errorf("Ended unexpectedly") // should never be reached } @@ -104,15 +104,15 @@ func GraphOpts(confs map[string]*Conf, bookname string, xaxis string, guidelines xvalues = append(xvalues, c.Pgnum) yvalues = append(yvalues, c.Conf) if i%tickevery == 0 { - ticks = append(ticks, chart.Tick{c.Pgnum, fmt.Sprintf("%.0f", c.Pgnum)}) + ticks = append(ticks, chart.Tick{Value: c.Pgnum, Label: fmt.Sprintf("%.0f", c.Pgnum)}) } } // Make last tick the final page final := graphconf[len(graphconf)-1] - ticks[len(ticks)-1] = chart.Tick{final.Pgnum, fmt.Sprintf("%.0f", final.Pgnum)} + ticks[len(ticks)-1] = chart.Tick{Value: final.Pgnum, Label: fmt.Sprintf("%.0f", final.Pgnum)} for i := 0; i <= yticknum; i++ { n := float64(i*100) / yticknum - yticks = append(yticks, chart.Tick{n, fmt.Sprintf("%.1f", n)}) + yticks = append(yticks, chart.Tick{Value: n, Label: fmt.Sprintf("%.1f", n)}) } mainSeries := chart.ContinuousSeries{ |