Skip to content
/ go-cmp Public

Package cmp provider generic functions for less-than, equal, and greater-than operations, for the Go programming language. This is to provide a more friendly (and less error-prone) developer-experience to the Cmp() method.

License

Notifications You must be signed in to change notification settings

reiver/go-cmp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Sep 19, 2024
934343f · Sep 19, 2024

History

4 Commits
Sep 19, 2024
Sep 19, 2024
Sep 19, 2024
Sep 19, 2024
Sep 19, 2024
Sep 19, 2024
Sep 19, 2024
Sep 19, 2024
Sep 19, 2024
Sep 19, 2024
Sep 19, 2024

Repository files navigation

go-cmp

Package cmp provider generic functions for less-than, equal, and greater-than operations, for the Go programming language.

This is to provide a more friendly (and less error-prone) developer-experience to the Cmp() method.

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-cmp

GoDoc

Examples

import "github.com/reiver/go-cmp"

// ...

var x *big.Int = big.NewInt(-5)
var y *big.Int = big.NewInt(10)

// ...

if cmp.LessThan(x,y) {
	// ...
}

// ...

if cmp.Equal(x,y) {
	// ...
}

// ...

if cmp.GreaterThan(x,y) {
	// ...
}

Import

To import package cmp use import code like the following:

import "github.com/reiver/go-cmp"

Installation

To install package cmp do the following:

GOPROXY=direct go get github.com/reiver/go-cmp

Author

Package cmp was written by Charles Iliya Krempeaux

About

Package cmp provider generic functions for less-than, equal, and greater-than operations, for the Go programming language. This is to provide a more friendly (and less error-prone) developer-experience to the Cmp() method.

Topics

Resources

License

Stars

Watchers

Forks

Languages