Fix linter errors, modernize command

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2023-09-01 19:07:51 +02:00
parent d5e3cdf7c3
commit cec63d6436
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5

View file

@ -1,3 +1,4 @@
//nolint:gomnd // Lots of index counts in here, makes not sense
package main
import (
@ -41,11 +42,6 @@ func initApp() error {
return errors.Wrap(err, "parsing cli options")
}
if cfg.VersionAndExit {
fmt.Printf("automod-debug %s\n", version)
os.Exit(0)
}
l, err := logrus.ParseLevel(cfg.LogLevel)
if err != nil {
return errors.Wrap(err, "parsing log-level")
@ -61,6 +57,11 @@ func main() {
logrus.WithError(err).Fatal("initializing app")
}
if cfg.VersionAndExit {
logrus.WithField("version", version).Info("twitch-bot-tools/automod-debug")
os.Exit(0)
}
var input struct {
Message string `json:"message"`
Tags struct {