diff --git a/cmd/revid-cli/main.go b/cmd/revid-cli/main.go index 5419fe3e..824d5491 100644 --- a/cmd/revid-cli/main.go +++ b/cmd/revid-cli/main.go @@ -332,6 +332,20 @@ func startRevid() { revidInst.Start() } +func createRevidInstance() { + // Try to create the revid instance with the given config + var err error + for revidInst, err = revid.NewRevid(config); err != nil; { + // If the config does have a logger, use it to output error, otherwise + // just output to std output + if config.Logger != nil { + config.Logger.Log(progName, "FATAL ERROR", err.Error()) + } else { + fmt.Printf("FATAL ERROR: %v", err.Error()) + } + } +} + func stopRevid() { revidInst.Stop() @@ -467,17 +481,3 @@ func revidReportActions(pin int) (int, error) { return -1, errors.New("External pin" + strconv.Itoa(pin) + " not defined") } } - -func createRevidInstance() { - // Try to create the revid instance with the given config - var err error - for revidInst, err = revid.NewRevid(config); err != nil; { - // If the config does have a logger, use it to output error, otherwise - // just output to std output - if config.Logger != nil { - config.Logger.Log(progName, "FATAL ERROR", err.Error()) - } else { - fmt.Printf("FATAL ERROR: %v", err.Error()) - } - } -}