Skip to content

Instantly share code, notes, and snippets.

@ankur22
Created May 30, 2020 13:36
Show Gist options
  • Save ankur22/82669c978691f31488da029320efbc0c to your computer and use it in GitHub Desktop.
Save ankur22/82669c978691f31488da029320efbc0c to your computer and use it in GitHub Desktop.
An example of a type which does not embed the struct but declares fields instead
type loggerAndChecker struct {
l *logger
c *checker
}
func main() {
var lc loggerAndChecker
in := "Hello World"
if lc.c.validate(in) {
lc.l.do(in)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment