-
Notifications
You must be signed in to change notification settings - Fork 12
/
embedding.go
27 lines (20 loc) · 869 Bytes
/
embedding.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Create a user type, and an admin type that embeds a user. Create a notifier
// interface, and make your user type satisfy that interface. Write a function
// that accepts a value of the interface type, and ensure it works correctly
// when passed a value of your admin type.
//
// Template available at: http://play.golang.org/p/5qrrcfHdiZ
package main
// Add your imports here.
// Define a `notifier` interface.
// Create a `user` type, with fields for name and email address. Ensure your
// type satisfies the Notifier interface.
// Create an `admin` type which embeds a user, and has a security level.
// Write a function that accepts a value of your interface and calls the method
// associated with that interface.
func funcName( /* args */ ) {
}
func main() {
// Create an admin user.
// Send the admin a notification via the function you created.
}