// FindProject looks up the Gitlab project. If the namespace is not provided in
// the project string it will search for projects in the users namespace
FindProject looks up the Gitlab project. If the namespace is not provided in
the project string it will search for projects in the users namespace
// FindProject looks up the Gitlab project . If the namespace is not provided in // the project string it will search for projects in the users namespace
func FindProject(project string) (*gitlab.Project, error) {
	if target, ok := localProjects[project]; ok {
		return target, nil
	}
	search := project
	if !strings.Contains(project, "/") {
		search = user + "/" + project
	}
	var opts gitlab.GetProjectOptions
	target, resp, err := lab.Projects.GetProject(search, &opts)
	if resp != nil && resp.StatusCode == http.StatusNotFound {
		return nil, ErrProjectNotFound
	}
	if err != nil {
		return nil, err
	}
	localProjects[project] = target
	return target, nil
}
func FindProject ( project string ) ( * gitlab . Project , error ) { if target , ok := localProjects [ project ] ; ok { return target , nil } search := project if ! strings . Contains ( project , " " ) { search = user + " " + project } var opts gitlab . GetProjectOptions target , resp , err := lab . Projects . GetProject ( search , & opts ) if resp != nil && resp . StatusCode == http . StatusNotFound { return nil , ErrProjectNotFound } if err != nil { return nil , err } localProjects [ project ] = target return target , nil }
FindProject looks up the Gitlab project.
FindProject looks up the Gitlab project .
// Assuming that a "/" in the project means its owned by an org // fwiw, I feel bad about this