Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
aka-bo committed Feb 12, 2025
1 parent e482f6e commit 97fbb8b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion samples/go/referenceapp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func createKMS(crypto appencryption.AEAD) (appencryption.KeyManagementService, e
}
}

func main() {
func parseFlags() {
if _, err := flags.Parse(&opts); err != nil {
var e *flags.Error
if errors.As(err, &e) && e.Type == flags.ErrHelp {
Expand All @@ -153,14 +153,22 @@ func main() {

panic(err)
}
}

func initLogging() {
logger.Init("Default", opts.Verbose, false, new(bytes.Buffer))

if opts.Verbose {
aelog.SetLogger(debugFunc(func(f string, v ...interface{}) {
logger.Infof("AppEncryption DEBUG: %s", fmt.Sprintf(f, v...))
}))
}
}

func main() {
parseFlags()

initLogging()

if opts.Payload != "" && opts.Drr != "" {
panic(errors.Errorf("either payload or drr can be provided"))
Expand Down

0 comments on commit 97fbb8b

Please sign in to comment.