mirror of
https://github.com/danog/liquid.git
synced 2024-11-30 06:08:57 +01:00
Lint
This commit is contained in:
parent
f15de87195
commit
09d36504b4
@ -42,6 +42,6 @@ const (
|
||||
TextChunkType ChunkType = iota
|
||||
// TagChunkType is the type of a tag Chunk "{%…%}"
|
||||
TagChunkType
|
||||
// TextChunkType is the type of an object Chunk "{{…}}"
|
||||
// ObjChunkType is the type of an object Chunk "{{…}}"
|
||||
ObjChunkType
|
||||
)
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
// {"{{x}}", "1"},
|
||||
// }
|
||||
|
||||
func ScanExpression(data string) ([]yySymType, error) {
|
||||
func scanExpression(data string) ([]yySymType, error) {
|
||||
l := newLexer([]byte(data))
|
||||
var symbols []yySymType
|
||||
var s yySymType
|
||||
@ -29,7 +29,7 @@ func ScanExpression(data string) ([]yySymType, error) {
|
||||
}
|
||||
|
||||
func TestExpressionScanner(t *testing.T) {
|
||||
tokens, err := ScanExpression("abc > 123")
|
||||
tokens, err := scanExpression("abc > 123")
|
||||
require.NoError(t, err)
|
||||
require.Len(t, tokens, 3)
|
||||
}
|
||||
|
@ -228,9 +228,7 @@ func reverseFilter(in []interface{}) interface{} {
|
||||
|
||||
func sortFilter(in []interface{}, key interface{}) []interface{} {
|
||||
out := make([]interface{}, len(in))
|
||||
for i, v := range in {
|
||||
out[i] = v
|
||||
}
|
||||
copy(out, in)
|
||||
if key == nil {
|
||||
generics.Sort(out)
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user