Please avoid parsing command line flags
rhuss opened this issue · 1 comments
If I understood correctly, the skillserver is meant to be run as a library. A library should never parse command line options, as it never knows in which context it is used. E.g. when embedded in another application this interfers with command liner parsing done by the caller itself.
I refer to this initialization:
go-alexa/skillserver/skillserver.go
Lines 140 to 141 in 1ffcf48
Instead of parsing a command line flag here, the Run
method should get the information whether to verify SSL certificates as argument to the method.
Originally it was written to be run as the server itself which is why it had command line flags. Obviously there would be no reason for CLI flags if it was only a library, but the more common use case is now is as a library.
I agree on with the idea (though the reason this hasn't come up before is that you really shouldn't skip the verification) for the skip verification, but I left some notes on the PR.