03-methods_interfaces_embedding/

directory
v0.0.0-...-d9b8774 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2015 License: Apache-2.0

Directories

Path Synopsis
01-methods
advanced/example1
Sample program to show how to declare function variables.
Sample program to show how to declare function variables.
example1
Sample program to show how to declare methods and how the Go compiler supports them.
Sample program to show how to declare methods and how the Go compiler supports them.
example2
Sample program to show how to declare methods against a named type.
Sample program to show how to declare methods against a named type.
exercises/exercise1
Declare a struct that represents a baseball player.
Declare a struct that represents a baseball player.
exercises/template1
Declare a struct that represents a baseball player.
Declare a struct that represents a baseball player.
02-interfaces
example1
Sample program to show how to use an interface in Go.
Sample program to show how to use an interface in Go.
example2
Sample program to show how polymorphic behavior with interfaces.
Sample program to show how polymorphic behavior with interfaces.
example3
Sample program to show how you can't always get the address of a value.
Sample program to show how you can't always get the address of a value.
exercises/exercise1
Declare an interface named speaker with a method named sayHello.
Declare an interface named speaker with a method named sayHello.
exercises/template1
Declare an interface named speaker with a method named sayHello.
Declare an interface named speaker with a method named sayHello.
03-embedding
example1
Sample program to show how what we are doing is NOT embedding a type but just using a type as a field.
Sample program to show how what we are doing is NOT embedding a type but just using a type as a field.
example2
Sample program to show how to embed a type into another type and the relationship between the inner and outer type.
Sample program to show how to embed a type into another type and the relationship between the inner and outer type.
example3
Sample program to show how embedded types work with interfaces.
Sample program to show how embedded types work with interfaces.
example4
Sample program to show what happens when the outer and inner type implement the same interface.
Sample program to show what happens when the outer and inner type implement the same interface.
exercises/exercise1
Copy the code from the template.
Copy the code from the template.
exercises/template1
Copy the code from the template.
Copy the code from the template.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL