mirror of
https://github.com/docker/docs.git
synced 2026-03-27 14:28:47 +07:00
Fix doc typo and add additional if condition
Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package state
|
||||
|
||||
// State represents the state of a hosts
|
||||
// State represents the state of a host
|
||||
type State int
|
||||
|
||||
const (
|
||||
@@ -25,9 +25,11 @@ var states = []string{
|
||||
"Error",
|
||||
}
|
||||
|
||||
// Given a State type, returns its string representation
|
||||
func (s State) String() string {
|
||||
if int(s) < len(states) {
|
||||
if int(s) >= 0 && int(s) < len(states) {
|
||||
return states[s]
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user