You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
305 B
Plaintext
14 lines
305 B
Plaintext
// interface declaration
|
|
type Awesomizer interface {
|
|
Awesomize() string
|
|
}
|
|
//
|
|
// types do *not* declare to implement interfaces
|
|
type Foo struct {}
|
|
//
|
|
// instead, types implicitly satisfy an interface
|
|
// if they implement all required methods
|
|
func (foo Foo) Awesomize() string {
|
|
return "Awesome!"
|
|
}
|