generic

package
v0.0.0-...-abd1f79 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2017 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package generic provides type-generic functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanOrder

func CanOrder(a, b interface{}) bool

CanOrder returns whether the values a and b are orderable according to the Go language specification.

func CanOrderR

func CanOrderR(k reflect.Kind) bool

CanOrderR returns whether two values of kind k are orderable according to the Go language specification.

func Order

func Order(a, b interface{}) int

Order returns the order of values a and b: -1 if a < b, 0 if a == b, 1 if a > b. The results are undefined if either a or b is NaN.

Order panics if a and b are not orderable according to the Go language specification.

func OrderR

func OrderR(a, b reflect.Value) int

OrderR is equivalent to Order, but operates on reflect.Values.

Types

type TypeError

type TypeError struct {
	Type1, Type2 reflect.Type
	Extra        string
}

func (TypeError) Error

func (e TypeError) Error() string

Directories

Path Synopsis
Package slice provides generic slice functions.
Package slice provides generic slice functions.

Jump to

Keyboard shortcuts

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