compare

package
v0.104.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: Apache-2.0 Imports: 3 Imported by: 94

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LessStrings added in v0.57.0

func LessStrings(s, t string) bool

LessStrings returns whether s is less than t lexicographically.

func Strings added in v0.57.0

func Strings(s, t string) int

Strings returns an integer comparing two strings lexicographically.

Types

type Comparer added in v0.37.1

type Comparer interface {
	Compare(other any) 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 returns whether this value is equal to the other.
	// This is for internal use.
	Eq(other any) 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 added in v0.55.0

type ProbablyEqer interface {
	// For internal use.
	ProbablyEq(other any) bool
}

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

Jump to

Keyboard shortcuts

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