hugo: Index | Files

package compare

import ""


Package Files

compare.go compare_strings.go

func LessStrings Uses

func LessStrings(s, t string) bool

LessStrings returns whether s is less than t lexicographically.

func Strings Uses

func Strings(s, t string) int

Strings returns an integer comparing two strings lexicographically.

type Comparer Uses

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 Uses

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 Uses

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

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

Package compare imports 3 packages (graph) and is imported by 121 packages. Updated 2019-08-12. Refresh now. Tools for package owners.