diff --git a/go/analysis/passes/composite/composite.go b/go/analysis/passes/composite/composite.go index 9cca7781..2abe7c6d 100644 --- a/go/analysis/passes/composite/composite.go +++ b/go/analysis/passes/composite/composite.go @@ -21,7 +21,16 @@ const Doc = `check for unkeyed composite literals This analyzer reports a diagnostic for composite literals of struct types imported from another package that do not use the field-keyed syntax. Such literals are fragile because the addition of a new field -(even if unexported) to the struct will cause compilation to fail.` +(even if unexported) to the struct will cause compilation to fail. + +As an example, + + err = &net.DNSConfigError{err} + +should be replaced by: + + err = &net.DNSConfigError{Err: err} +` var Analyzer = &analysis.Analyzer{ Name: "composites",