X Tutup
Skip to content

Commit cdfa729

Browse files
committed
Simplify code
Signed-off-by: David Gageot <david@gageot.net>
1 parent 181a1d4 commit cdfa729

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/generic/generic.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,13 @@ func (d *Driver) GetURL() (string, error) {
142142

143143
func (d *Driver) GetState() (state.State, error) {
144144
address := net.JoinHostPort(d.IPAddress, strconv.Itoa(d.SSHPort))
145+
145146
_, err := net.DialTimeout("tcp", address, defaultTimeout)
146-
var st state.State
147147
if err != nil {
148-
st = state.Stopped
149-
} else {
150-
st = state.Running
148+
return state.Stopped, nil
151149
}
152-
return st, nil
150+
151+
return state.Running, nil
153152
}
154153

155154
func (d *Driver) Start() error {

0 commit comments

Comments
 (0)
X Tutup