robots/coverage/diff/diff.go
func findChanges(baseList *calculation.CoverageList, newList *calculation.CoverageList) []*coverageChange {
	var changes []*coverageChange
	baseFilesMap := toMap(baseList)
	for _, newCov := range newList.Group {
		baseCov, ok := baseFilesMap[newCov.Name]
		var baseRatio float32
		if !ok {
			baseRatio = -1
		} else {
			baseRatio = baseCov.Ratio()
		}
		newRatio := newCov.Ratio()
		if isChangeSignificant(baseRatio, newRatio) {
			changes = append(changes, &coverageChange{
				name:      newCov.Name,
				baseRatio: baseRatio,
				newRatio:  newRatio,
			})
		}
	}
	return changes
}
func findChanges(baseList *calculation.CoverageList, newList *calculation.CoverageList) []*coverageChange {
	var changes []*coverageChange
	baseFilesMap := toMap(baseList)
	for _, newCov := range newList.Group {
		baseCov, ok := baseFilesMap[newCov.Name]
		var baseRatio float32
		if !ok {
			baseRatio = -1
		} else {
			baseRatio = baseCov.Ratio()
		}
		newRatio := newCov.Ratio()
		if isChangeSignificant(baseRatio, newRatio) {
			changes = append(changes, &coverageChange{
				name:      newCov.Name,
				baseRatio: baseRatio,
				newRatio:  newRatio,
			})
		}
	}
	return changes
}
func findChanges ( baseList * calculation . CoverageList , newList * calculation . CoverageList ) [ ] * coverageChange { var changes [ ] * coverageChange baseFilesMap := toMap ( baseList ) for _ , newCov := range newList . Group { baseCov , ok := baseFilesMap [ newCov . Name ] var baseRatio float32 if ! ok { baseRatio = - 1 } else { baseRatio = baseCov . Ratio ( ) } newRatio := newCov . Ratio ( ) if isChangeSignificant ( baseRatio , newRatio ) { changes = append ( changes , & coverageChange { name : newCov . Name , baseRatio : baseRatio , newRatio : newRatio , } ) } } return changes }
// findChanges compares the newList of coverage against the base list and returns the result
findChanges compares the newList of coverage against the base list and returns the result