package compare

import "github.com/gohugoio/hugo/compare"

Index

Types

type Comparer

type Comparer interface {
	Compare(other interface{}) int
}

Comparer can be used to compare two values. This will be used when using the le, ge etc. operators in the templates. Compare returns -1 if the given version is less than, 0 if equal and 1 if greater than the running version.

type Eqer

type Eqer interface {
	Eq(other interface{}) bool
}

Eqer can be used to determine if this value is equal to the other. The semantics of equals is that the two value are interchangeable in the Hugo templates.

type ProbablyEqer

type ProbablyEqer interface {
	ProbablyEq(other interface{}) bool
}

ProbablyEq is an equal check that may return false positives, but never a false negative.

Source Files

compare.go

Version
v0.56.2
Published
Jul 30, 2019
Platform
js/wasm
Last checked
56 seconds ago

Tools for package owners.