func (c *orgRepoConfig) difference(c2 *orgRepoConfig) *orgRepoConfig {
	res := &orgRepoConfig{
		orgExceptions: make(map[string]sets.String),
		repos:         sets.NewString().Union(c.repos),
	}
	for org, excepts1 := range c.orgExceptions {
		if excepts2, ok := c2.orgExceptions[org]; ok {
			res.repos.Insert(excepts2.Difference(excepts1).UnsortedList()...)
		} else {
			excepts := sets.NewString().Union(excepts1)
			// Add any applicable repos in repos2 to excepts
			for _, repo := range c2.repos.UnsortedList() {
				if parts := strings.SplitN(repo, "/", 2); len(parts) == 2 && parts[0] == org {
					excepts.Insert(repo)
				}
			}
			res.orgExceptions[org] = excepts
		}
	}

	res.repos = res.repos.Difference(c2.repos)

	for _, repo := range res.repos.UnsortedList() {
		if parts := strings.SplitN(repo, "/", 2); len(parts) == 2 {
			if excepts2, ok := c2.orgExceptions[parts[0]]; ok && !excepts2.Has(repo) {
				res.repos.Delete(repo)
			}
		}
	}
	return res
}
func (c *orgRepoConfig) difference(c2 *orgRepoConfig) *orgRepoConfig {
	res := &orgRepoConfig{
		orgExceptions: make(map[string]sets.String),
		repos:         sets.NewString().Union(c.repos),
	}
	for org, excepts1 := range c.orgExceptions {
		if excepts2, ok := c2.orgExceptions[org]; ok {
			res.repos.Insert(excepts2.Difference(excepts1).UnsortedList()...)
		} else {
			excepts := sets.NewString().Union(excepts1)
			// Add any applicable repos in repos2 to excepts
			for _, repo := range c2.repos.UnsortedList() {
				if parts := strings.SplitN(repo, "/", 2); len(parts) == 2 && parts[0] == org {
					excepts.Insert(repo)
				}
			}
			res.orgExceptions[org] = excepts
		}
	}

	res.repos = res.repos.Difference(c2.repos)

	for _, repo := range res.repos.UnsortedList() {
		if parts := strings.SplitN(repo, "/", 2); len(parts) == 2 {
			if excepts2, ok := c2.orgExceptions[parts[0]]; ok && !excepts2.Has(repo) {
				res.repos.Delete(repo)
			}
		}
	}
	return res
}
func ( c * orgRepoConfig ) difference ( c2 * orgRepoConfig ) * orgRepoConfig { res := & orgRepoConfig { orgExceptions : make ( map [ string ] sets . String ) , repos : sets . NewString ( ) . Union ( c . repos ) , } for org , excepts1 := range c . orgExceptions { if excepts2 , ok := c2 . orgExceptions [ org ] ; ok { res . repos . Insert ( excepts2 . Difference ( excepts1 ) . UnsortedList ( ) ... ) } else { excepts := sets . NewString ( ) . Union ( excepts1 ) // Add any applicable repos in repos2 to excepts for _ , repo := range c2 . repos . UnsortedList ( ) { if parts := strings . SplitN ( repo , " " , 2 ) ; len ( parts ) == 2 && parts [ 0 ] == org { excepts . Insert ( repo ) } } res . orgExceptions [ org ] = excepts } } res . repos = res . repos . Difference ( c2 . repos ) for _ , repo := range res . repos . UnsortedList ( ) { if parts := strings . SplitN ( repo , " " , 2 ) ; len ( parts ) == 2 { if excepts2 , ok := c2 . orgExceptions [ parts [ 0 ] ] ; ok && ! excepts2 . Has ( repo ) { res . repos . Delete ( repo ) } } } return res }
// difference returns a new orgRepoConfig that represents the set difference of
// the repos specified by the receiver and the parameter orgRepoConfigs.
difference returns a new orgRepoConfig that represents the set difference of the repos specified by the receiver and the parameter orgRepoConfigs .