https://github.com/reiver/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.
https://github.com/reiver/go-cmp
equal greater-than less-than
Last synced: 10 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/reiver/go-cmp
- Owner: reiver
- License: mit
- Created: 2024-09-19T13:17:27.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-09-19T13:24:49.000Z (over 1 year ago)
- Last Synced: 2025-01-25T13:08:04.447Z (12 months ago)
- Topics: equal, greater-than, less-than
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
[](https://godoc.org/github.com/reiver/go-cmp)
## Examples
```golang
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](http://reiver.link)