Go: Check for Network Connection : how can I check if I am able to connect to a server via ssh before running a program on it? 

This is how I am connecting to a server:
`cli := ssh.NewSSHClient(conf.User, randomServer)`

and I would like to either use switch or an if statement 

P.S.: I am super new to Go.