Open
Description
I would like to suggest improvement to existing Vet Composite linter.
Currently, composite
requires struct field names to be specified only, if given type is defined in different package. However, I believe, same restrictions should be done for type within same package. Because if some struct is used in many places, adding 1 field requires changed everywhere. Even, if it is irrelevant and I would be specifying only empty value.
Not to introduce breaking change, it would be possible to turn this on by flag.
Meaning all those selected lines (30 - 68) would be raising issue https://cs.opensource.google/go/x/tools/+/effd83eb4d44f4443100debb7ede6619a4ac6528:go/analysis/passes/composite/testdata/src/a/a.go;l=30-68
Metadata
Metadata
Assignees
Labels
Issues related to static analysis (vet, x/tools/go/analysis)Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.Issues describing a requested change to a Go tool or command-line program.This label describes issues relating to any tools in the x/tools repository.