int64y

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(v int64) int64

Abs returns the absolute value of v.

func Contains

func Contains(vs []int64, v int64) bool

Contains returns true if vs contains v.

func FromString

func FromString(s string) (int64, error)

FromString parses s and returns a int64.

func Int64

func Int64(v *int64) int64

Int64 dereferences and returns int64. The int64 default value is returned if v is nil.

func Int64OrDefault

func Int64OrDefault(v *int64, defaultVal int64) *int64

Int64OrDefault returns int64 if it is not nil, and a pointer to defaultVal otherwise.

func Max

func Max(v int64, vs ...int64) int64

Max returns the maximum value from v and vs.

func Min

func Min(v int64, vs ...int64) int64

Min returns the minimum value from v and vs.

func Pointer

func Pointer(v int64) *int64

Pointer returns a pointer to the given int64.

func Random

func Random() int64

Random returns a non-negative pseudo-random number of type int64

func RandomN

func RandomN(n int64) int64

RandomN returns a non-negative pseudo-random number in [0,n) of type int64. It panics if n <= 0.

func Sort

func Sort(vs []int64) []int64

Sort sorts data in place. Not guaranteed to be stable.

func Unique

func Unique(vs []int64) []int64

Unique returns a new list containing unique int64s from the given input

Types

type Int64Slice

type Int64Slice []int64

func (Int64Slice) Len

func (p Int64Slice) Len() int

func (Int64Slice) Less

func (p Int64Slice) Less(i, j int) bool

func (Int64Slice) Swap

func (p Int64Slice) Swap(i, j int)

type Set

type Set map[int64]struct{}

func MakeSet

func MakeSet(vs ...int64) Set

MakeSet returns a lookup map for int64

func ToSet

func ToSet(vs []int64) Set

ToSet returns a lookup map for int64.

func (Set) Contains

func (s Set) Contains(v int64) bool

Contains returns true if Set contains v.

func (Set) Equal

func (s Set) Equal(s2 Set) bool

Equal checks whether all

func (Set) Intersect

func (s Set) Intersect(s2 Set) Set

Intersect returns the intersection of two Sets.

func (Set) Union

func (s Set) Union(s2 Set) Set

Union returns the union of two Sets.

Jump to

Keyboard shortcuts

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