func resume(e *ec2.EC2, args ...string) { if len(args) == 0 { fmt.Fprintf(os.Stderr, "resume: need instance id\n") os.Exit(1) } resp, err := e.StartInstances(args...) if err != nil { fmt.Fprintf(os.Stderr, "stop: %s\n", err) os.Exit(1) } for _, r := range resp.StateChanges { fmt.Printf("state change: %s → %s\n", r.PreviousState.Name, r.CurrentState.Name) } }