wand/internal/tests/testlib/lib.go

49 lines
649 B
Go

package testlib
import (
"io"
"time"
)
type Options struct {
// Foo is an option.
Foo int
// Bars, any number.
Bar []string
// Duration is another option.
Duration time.Duration
// Time is the third option here.
Time time.Time
// Some is an option of any type.
Some any
}
type OptionWithHelp struct {
// Custom help.
Help bool
}
// Foo sums three numbers.
// It prints the sum to stdout.
//
// The input numbers can be any integer.
func Foo(a, b, c int) int {
return a + b + c
}
func Bar(out io.Writer, a, b, c int) int {
return a + b + c
}
func Baz(o Options) int {
return o.Foo
}
func CustomHelp(o OptionWithHelp) {}