Documentation ¶
Overview ¶
Package exportdefault provides the functionality to automatically generate package-level exported functions wrapping calls to a package-level default instance of a type.
This helps auto-generating code for the common use case where a package implements certain information as methods within a stub and, for convenience, exports functions that wrap calls to those methods on a default variable.
Some examples of that behaviour in the stdlib:
- `net/http` has `http.DefaultClient` and functions like `http.Get` just call the default `http.DefaultClient.Get`
- `log` has `log.Logger` and functions like `log.Print` just call the default `log.std.Print`
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct { Name string Imports map[string]string FuncNamePrefix string Include *regexp.Regexp Exclude *regexp.Regexp // contains filtered or unexported fields }
Generator contains the metadata needed to generate all the function wrappers arround methods from a package variable
Click to show internal directories.
Click to hide internal directories.