feat(geoip, info): write comprehensive unit tests

This commit is contained in:
Simone Basso 2020-11-13 21:16:43 +01:00
commit 7eedf4d947
6 changed files with 415 additions and 41 deletions

View file

@ -19,6 +19,15 @@ var Command = Cmd.Command
// Init should be called by all subcommand that care to have a ooni.Context instance
var Init func() (*ooni.Probe, error)
// NewProbeCLI is like Init but returns a ooni.ProbeCLI instead.
func NewProbeCLI() (ooni.ProbeCLI, error) {
probeCLI, err := Init()
if err != nil {
return nil, err
}
return probeCLI, nil
}
func init() {
configPath := Cmd.Flag("config", "Set a custom config file path").Short('c').String()