Is there a way how to set that certain flags are mandatory, or do I have to check for their presence on my own?
I like github.com/jessevdk/go-flags package to use in CLI. It provides a required attribute, to set a mandatory flag:
required
var opts struct { ... // Example of a required flag Name string `short:"n" long:"name" description:"A name" required:"true"` ... }