func cleanupProject(project *Project) error {
	if project.Branches == nil {
		return nil
	}

	newBranches := map[string]Branch{}
	for name, branch := range project.Branches {
		escapedName, err := url.QueryUnescape(name)
		if err != nil {
			return fmt.Errorf("error url decoding branch name '%s':  %s", name, err)
		}

		newBranches[escapedName] = branch
	}
	project.Branches = newBranches

	return nil
}
func cleanupProject(project *Project) error {
	if project.Branches == nil {
		return nil
	}

	newBranches := map[string]Branch{}
	for name, branch := range project.Branches {
		escapedName, err := url.QueryUnescape(name)
		if err != nil {
			return fmt.Errorf("error url decoding branch name '%s':  %s", name, err)
		}

		newBranches[escapedName] = branch
	}
	project.Branches = newBranches

	return nil
}
func cleanupProject ( project * Project ) error { if project . Branches == nil { return nil } newBranches := map [ string ] Branch { } for name , branch := range project . Branches { escapedName , err := url . QueryUnescape ( name ) if err != nil { return fmt . Errorf ( " " , name , err ) } newBranches [ escapedName ] = branch } project . Branches = newBranches return nil }
// clean up project returned from API by:
// * url decoding branch names (https://discuss.circleci.com/t/api-returns-url-encoded-branch-names-in-json-response/18524/5)
clean up project returned from API by : * url decoding branch names ( https : // discuss . circleci . com / t / api - returns - url - encoded - branch - names - in - json - response / 18524 / 5 )