Closed vidmed closed 5 years ago
The override type definition is usually only needed for gencodec. Running golint or staticcheck can mark this type definition as unused. writeUseOfOverride
just ensures that the override type is used so that linters don't report it as unused.
Could you please explain me for what purpose do you use this function
func writeUseOfOverride(w io.Writer, n *types.Named, qf types.Qualifier) { name := types.TypeString(types.NewPointer(n), qf) fmt.Fprintf(w, "var _ = (%s)(nil)\n", name) }
This generates line like thisvar _ = (*txdataMarshaling)(nil)
For what purpose this instruction needed? Thanks for your help beforehand