bradleyfalzon / apicompat

apicompat checks recent changes to a Go project for backwards incompatible changes
https://abicheck.bradleyf.id.au
MIT License
179 stars 5 forks source link

Func parameter inferred types detected as a breaking change #16

Closed bradleyfalzon closed 8 years ago

bradleyfalzon commented 8 years ago

The following is not a breaking change:

go1.5:ftoa.go:50: breaking change parameter types changed
        func AppendFloat(dst []byte, f float64, fmt byte, prec int, bitSize int) []byte
        func AppendFloat(dst []byte, f float64, fmt byte, prec, bitSize int) []byte
bradleyfalzon commented 8 years ago

Needs to be fixed by normalising the fields so there's just one name per type, similar to a276ea18771545033e3f5152b5eb0e15739103b8

bradleyfalzon commented 8 years ago

This could also occur on func and interface types for both parameters and results. Fortunately the related a276ea18771545033e3f5152b5eb0e15739103b8 works on []*ast.Field, which all mentioned types are, so the code there just needs to be abstracted into its own function with a parameter exportedOnly which removes variables that aren't exported for the struct cases.

bradleyfalzon commented 8 years ago

Fixed in 01b4663788253d32ef559f8bae451d92f6cce9bd