diff --git a/templates/goshared/msg.go b/templates/goshared/msg.go index 98657f495..f3030da12 100644 --- a/templates/goshared/msg.go +++ b/templates/goshared/msg.go @@ -95,7 +95,7 @@ type {{ multierrname . }} []error // Error returns a concatenation of all the error messages it wraps. func (m {{ multierrname . }}) Error() string { - var msgs []string + msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) }