Debian Codegraph @

docs/content/en/functions/compare/Lt.md

raw
1 ---
2 title: compare.Lt
3 description: Returns the boolean truth of arg1 < arg2 && arg1 < arg3.
4 categories: []
5 keywords: []
6 params:
7 functions_and_methods:
8 aliases: [lt]
9 returnType: bool
10 signatures: ['compare.Lt ARG1 ARG2 [ARG...]']
11 aliases: [/functions/lt]
12 ---
13
14 ```go-html-template
15 {{ lt 1 1 }} → false
16 {{ lt 1 2 }} → true
17 {{ lt 2 1 }} → false
18
19 {{ lt 1 1 1 }} → false
20 {{ lt 1 1 2 }} → false
21 {{ lt 1 2 1 }} → false
22 {{ lt 1 2 2 }} → true
23
24 {{ lt 2 1 1 }} → false
25 {{ lt 2 1 2 }} → false
26 {{ lt 2 2 1 }} → false
27 ```
28
29 Use the `compare.Lt` function to compare other data types as well:
30
31 ```go-html-template
32 {{ lt "ab" "a" }} → false
33 {{ lt time.Now (time.AsTime "1964-12-30") }} → false
34 {{ lt true false }} → false
35 ```