package returns
import "github.com/mmcloughlin/avo/examples/returns"
Package returns demonstrates how to write function return values in avo.
Index ¶
- func Butterfly(x0 float64, x1 float64) (y0 float64, y1 float64)
- func CriticalLine(t float64) complex128
- func Interval(start uint64, size uint64) (uint64, uint64)
- func Septuple(byte) [7]byte
- type Struct
Functions ¶
func Butterfly ¶
Butterfly performs a 2-dimensional butterfly operation: computes (x0+x1, x0-x1). Demonstrates multiple named return values.
func CriticalLine ¶
func CriticalLine(t float64) complex128
CriticalLine returns the complex value 0.5 + it on Riemann's critical line. Demonstrates returning complex values.
func Interval ¶
Interval returns the (start, end) of an interval with the given start and size. Demonstrates multiple unnamed return values.
func Septuple ¶
Septuple returns an array of seven of the given byte. Demonstrates returning array values.
Types ¶
type Struct ¶
Struct is used to demonstrate writing struct return values.
func NewStruct ¶
NewStruct initializes a Struct value. Demonstrates returning struct values.
Source Files ¶
- Version
- v0.6.0 (latest)
- Published
- Jan 7, 2024
- Platform
- linux/amd64
- Last checked
- 1 month ago –
Tools for package owners.