package state

// State represents the state of a hosts
type State int

const (
	None State = iota
	Running
	Paused
	Saved
	Stopped
	Stopping
	Starting
	Error
)

var states = []string{
	"",
	"Running",
	"Paused",
	"Saved",
	"Stopped",
	"Stopping",
	"Starting",
	"Error",
}

func (s State) String() string {
	if int(s) < len(states) {
		return states[s]
	}
	return ""
}

package state

// State represents the state of a host
type State int

const (
	None State = iota
	Running
	Paused
	Saved
	Stopped
	Stopping
	Starting
	Error
)

var states = []string{
	"",
	"Running",
	"Paused",
	"Saved",
	"Stopped",
	"Stopping",
	"Starting",
	"Error",
}

// Given a State type, returns its string representation
func (s State) String() string {
	if int(s) >= 0 && int(s) < len(states) {
		return states[s]
	} else {
		return ""
	}
}

Fix doc typo and add additional if condition
Fix doc typo and add additional if condition

Signed-off-by: Ankush Agarwal <fbce221e53f28a6368ebb5e0aa2ee1c79ff12e9e@gmail.com>
