Hi I have this function which I want to return a docker.APIContainer and an error (nil if no errors), but in case of error what should I return in docker.APIContainer ?
this is the code
func GetContainersRunningImage(imagename string, tag string) ([]docker.Container,string) {
logFields := log.Fields{
"handler": "get service",
}
client, err := docker.NewTLSClient(sconf.DockConf.Endpoint, sconf.DockConf.Cert, sconf.DockConf.Key, sconf.DockConf.Ca)
if err != nil {
log.WithFields(logFields).Errorf("TLSClient could not be created: %s", err)
return _,err.Error()
}
}
what should I add instead of _? Am I obliged to create a var contarray []docker.Container
and return it? or is there another way