func TestIdentify(t *testing.T) { info, err := platform.Identify() if err != nil { t.Errorf("got error: %v", err) } t.Log(info) }
func TestDetect(t *testing.T) { f, err := platform.Identify() if err != nil { t.Errorf("got error, %v", err) } t.Log(f) }
func (s *Removed) stateForSpecificPlatform() (state.State, error) { p, err := platform.Identify() if err != nil { return nil, err } switch platform.Family(p.Get("family")) { case platform.FamilyDebian: return &RemovedForDebian{s}, nil } return nil, errors.New("unsupported platform") }
func TestMain(m *testing.M) { p, err := platform.Identify() if err != nil { return } if p.Get("family") != string(platform.FamilyDebian) { return } os.Exit(m.Run()) }
func usage() { usage := ` Usage: opit COMMAND [ARGUMENTS] opit is a command line interface of orchestra-pit. ` fmt.Println(strings.TrimSpace(usage)) fmt.Println("\nCommands:") for name, command := range commands { fmt.Printf(" %-8s %s\n", name, command.description()) } fmt.Println("") fmt.Println("Use \"opit COMMAND -h\" for more information about the commands.") p, err := platform.Identify() if err == nil { if platform.Family(p.Get("family")) == platform.FamilyDebian { fmt.Println("\n -- opit has Super Cow Powers now --") } } }