column

package
v0.0.0-...-5948a14 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2020 License: CC0-1.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByColumns

type ByColumns struct {
	// contains filtered or unexported fields
}

ByColumns sorts by a specified column

func NewByColumns

func NewByColumns(p []Person, maxColumns int) *ByColumns

NewByColumns creates a new ByColumns type

func (*ByColumns) Len

func (c *ByColumns) Len() int

func (*ByColumns) Less

func (c *ByColumns) Less(i, j int) bool

func (*ByColumns) LessAge

func (c *ByColumns) LessAge(a, b *Person) comparison

LessAge compares less age

func (*ByColumns) LessName

func (c *ByColumns) LessName(a, b *Person) comparison

LessName compares names

func (*ByColumns) LessSumOfAgeDigits

func (c *ByColumns) LessSumOfAgeDigits(a, b *Person) comparison

LessSumOfAgeDigits compares ages

func (*ByColumns) Select

func (c *ByColumns) Select(cmp columnCmp)

func (*ByColumns) Swap

func (c *ByColumns) Swap(i, j int)

type Person

type Person struct {
	Name string
	Age  int
}

Person represents a person

func (Person) String

func (p Person) String() string

Jump to

Keyboard shortcuts

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