func (chk DockerImage) Status() (int, string, error) { images, err := dockerstatus.DockerImageRepositories() if err != nil { return 1, "", err } if tabular.StrIn(chk.name, images) { return errutil.Success() } return errutil.GenericError("Docker image was not found", chk.name, images) }
func (chk DockerImageRegexp) Status() (int, string, error) { images, err := dockerstatus.DockerImageRepositories() if err != nil { return 1, "", err } if tabular.ReIn(chk.re, images) { return errutil.Success() } msg := "Docker image was not found." return errutil.GenericError(msg, chk.re.String(), images) }