diff options
author | Nick White <git@njw.name> | 2022-10-27 16:36:31 +0100 |
---|---|---|
committer | Nick White <git@njw.name> | 2022-10-27 16:36:31 +0100 |
commit | ed2073111d0373228c7dfd95dca877bb9420a987 (patch) | |
tree | 2950548390fd5a0d8dde565709f32ebf5adb0520 /cmd | |
parent | 2aabbfeb7173d682fc28cc512afc13bab2ce0ee7 (diff) |
Pass log around as pointer to fix go vet pointing out that this meant copying a sync.Mutex
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/rescribe/gui.go | 2 | ||||
-rw-r--r-- | cmd/rescribe/main.go | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/cmd/rescribe/gui.go b/cmd/rescribe/gui.go index f03d66e..ef58fce 100644 --- a/cmd/rescribe/gui.go +++ b/cmd/rescribe/gui.go @@ -219,7 +219,7 @@ func formatProgressBarText(bar *widget.ProgressBar) func() string { } // startGui starts the gui process -func startGui(log log.Logger, cmd string, gbookcmd string, training string, tessdir string) error { +func startGui(log *log.Logger, cmd string, gbookcmd string, training string, tessdir string) error { myApp := app.New() myWindow := myApp.NewWindow("Rescribe OCR") diff --git a/cmd/rescribe/main.go b/cmd/rescribe/main.go index c9118a8..74f6440 100644 --- a/cmd/rescribe/main.go +++ b/cmd/rescribe/main.go @@ -259,7 +259,7 @@ These training files are included in rescribe, and are always available: } if flag.NArg() < 1 || *usegui { - err := startGui(*verboselog, tessCommand, gbookCommand, trainingName, tessdir) + err := startGui(verboselog, tessCommand, gbookCommand, trainingName, tessdir) err = os.RemoveAll(tessdir) if err != nil { log.Printf("Error removing tesseract directory %s: %v", tessdir, err) @@ -319,7 +319,7 @@ These training files are included in rescribe, and are always available: ispdf = true } - err = startProcess(ctx, *verboselog, tessCommand, bookdir, bookname, trainingName, savedir, tessdir, !*wipe, *fullpdf) + err = startProcess(ctx, verboselog, tessCommand, bookdir, bookname, trainingName, savedir, tessdir, !*wipe, *fullpdf) if err != nil { log.Fatalln(err) } @@ -459,7 +459,7 @@ func rmIfNotImage(f string) error { return nil } -func startProcess(ctx context.Context, logger log.Logger, tessCommand string, bookdir string, bookname string, trainingName string, savedir string, tessdir string, nowipe bool, fullpdf bool) error { +func startProcess(ctx context.Context, logger *log.Logger, tessCommand string, bookdir string, bookname string, trainingName string, savedir string, tessdir string, nowipe bool, fullpdf bool) error { cmd := exec.Command(tessCommand, "--help") pipeline.HideCmd(cmd) _, err := cmd.Output() @@ -478,7 +478,7 @@ func startProcess(ctx context.Context, logger log.Logger, tessCommand string, bo } var conn Pipeliner - conn = &bookpipeline.LocalConn{Logger: &logger, TempDir: tempdir} + conn = &bookpipeline.LocalConn{Logger: logger, TempDir: tempdir} conn.Log("Setting up session") err = conn.Init() |