func ComparePackages(a, b interface{}) ([]*ObjectDiff, error) {
	pkga, err := parseAndCheckPackage(a)
	if err != nil {
		return nil, err
	}

	pkgb, err := parseAndCheckPackage(b)
	if err != nil {
		return nil, err
	}

	var diffs []*ObjectDiff
	for _, name := range pkga.scope.Names() {
		x := pkga.scope.Lookup(name)
		if !x.Exported() {
			continue
		}
		y := pkgb.scope.Lookup(name)
		if typecmp.Compatible(x, y) {
			continue
		}
		objx := &Object{x, pkga.fset, pkga.decls[name]}
		objy := &Object{y, pkgb.fset, pkgb.decls[name]}
		diffs = append(diffs, &ObjectDiff{objx, objy})
	}

	return diffs, nil
}
// ComparePackages returns the breaking changes introduced by package b
// relative to package a.
//
// A package can be passed as either a string or a map of string -> io.Reader.
// If a string, it is the path to the package.
// If a map, it maps filenames to source code.
ComparePackages returns the breaking changes introduced by package b
relative to package a.

A package can be passed as either a string or a map of string -> io.Reader.
If a string, it is the path to the package.
If a map, it maps filenames to source code.
// ComparePackages returns the breaking changes introduced by package b // relative to package a . // // A package can be passed as either a string or a map of string - > io . Reader . // If a string it is the path to the package . // If a map it maps filenames to source code .
func ComparePackages(a, b interface{}) ([]*ObjectDiff, error) {
	pkga, err := parseAndCheckPackage(a)
	if err != nil {
		return nil, err
	}
	pkgb, err := parseAndCheckPackage(b)
	if err != nil {
		return nil, err
	}
	var diffs []*ObjectDiff
	for _, name := range pkga.scope.Names() {
		x := pkga.scope.Lookup(name)
		if !x.Exported() {
			continue
		}
		y := pkgb.scope.Lookup(name)
		if typecmp.Compatible(x, y) {
			continue
		}
		objx := &Object{x, pkga.fset, pkga.decls[name]}
		objy := &Object{y, pkgb.fset, pkgb.decls[name]}
		diffs = append(diffs, &ObjectDiff{objx, objy})
	}
	return diffs, nil
}
func ComparePackages ( a , b interface { } ) ( [ ] * ObjectDiff , error ) { pkga , err := parseAndCheckPackage ( a ) if err != nil { return nil , err } pkgb , err := parseAndCheckPackage ( b ) if err != nil { return nil , err } var diffs [ ] * ObjectDiff for _ , name := range pkga . scope . Names ( ) { x := pkga . scope . Lookup ( name ) if ! x . Exported ( ) { continue } y := pkgb . scope . Lookup ( name ) if typecmp . Compatible ( x , y ) { continue } objx := & Object { x , pkga . fset , pkga . decls [ name ] } objy := & Object { y , pkgb . fset , pkgb . decls [ name ] } diffs = append ( diffs , & ObjectDiff { objx , objy } ) } return diffs , nil }
ComparePackages returns the breaking changes introduced by package b
relative to package a.
ComparePackages returns the breaking changes introduced by package b relative to package a .