Documentation ¶
Overview ¶
Package sink covers most, if not all, patterns to adequately-test gadget's capabilities.
Index ¶
Examples ¶
Constants ¶
const ( ONE = 1 // represents the number 1 TWO = 2 // represents the number 2 THREE = 3 // represents the number 3 )
a block comment describing const assignments:
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EmbeddedStructTest ¶
type EmbeddedStructTest struct {
Occupation string // a standard job title.
}
EmbeddedStructTest represents an example of an embedded struct.
type GenericRandomType ¶
type GenericStructTest ¶
type GenericStructTest[T any] struct { First string Last string Age int // contains filtered or unexported fields }
GenericStructTest represents an example of a generic struct.
func NewGenericStructTest ¶
func NewGenericStructTest[T any](first, last string, age int) *GenericStructTest[T]
NewGenericStructTest returns a new instance of GenericStructTest.
func (GenericStructTest[T]) GetFullName ¶
func (nst GenericStructTest[T]) GetFullName() string
GetFullName is an function that attempts to return a full name.
func (*GenericStructTest[T]) GetPrivate ¶
func (nst *GenericStructTest[T]) GetPrivate() string
GetPrivate is an accessor method that returns a dark secret.
func (GenericStructTest[T]) IsBlank ¶
func (nst GenericStructTest[T]) IsBlank()
IsBlank is an function that does not have a body.
type InterfaceTest ¶
type InterfaceTest interface {
ImplementMe() // this should be added to your data structures to implement this interface.
}
InterfaceTest is an example of an interface definition.
type NormalChannelType ¶
type NormalChannelType chan bool
type NormalFuncType ¶
type NormalFuncType func() bool
type NormalRandomType ¶
type NormalStructTest ¶
type NormalStructTest struct { First string // first name Last string // last name Age int // age *EmbeddedStructTest // an embedded struct // contains filtered or unexported fields }
NormalStructTest represents an example of a top-level struct.
func NewNormalStructTest ¶
func NewNormalStructTest(first, last string, age int) *NormalStructTest
NewNormalStructTest returns a new instance of NormalStructTest.
Example ¶
package main import ( "fmt" "github.com/wilhelm-murdoch/go-gadget/sink" ) func main() { s := sink.NewNormalStructTest("Wilhelm", "Murdoch", 40) fmt.Println(s.First, s.Last) }
Output: Wilhelm Murdoch
func (NormalStructTest) GetFullName ¶
func (nst NormalStructTest) GetFullName() string
GetFullName is an function that attempts to return a full name.
func (*NormalStructTest) GetOccupation ¶
func (nst *NormalStructTest) GetOccupation() string
GetOccupation is an accessor method that returns an occupation.
func (*NormalStructTest) GetPrivate ¶
func (nst *NormalStructTest) GetPrivate() string
GetPrivate is an accessor method that returns a dark secret.