Created
May 30, 2020 13:36
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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