polymorphism

package
v0.0.0-...-f81d041 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaySlogan

func SaySlogan(sloganSayer SloganSayer)

SaySlogan takes in a parameter of type SloganSayer

Types

type Hillary

type Hillary struct{}

Hillary implicitly satisfies the SloganSayer interface by implementing the function Slogan. Thus, Hillary is also of type SloganSayer.

func (*Hillary) Slogan

func (h *Hillary) Slogan()

type SloganSayer

type SloganSayer interface {
	Slogan()
}

type Trump

type Trump struct{}

same idea for Trump

func (*Trump) Slogan

func (t *Trump) Slogan()

Jump to

Keyboard shortcuts

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