diff --git a/Gopkg.lock b/Gopkg.lock index 8faf511..cf38842 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,14 +2,14 @@ [[projects]] - branch = "master" - name = "github.com/savaki/jq" + branch = "rename-imports" + name = "github.com/gabesullice/jq" packages = [".","scanner"] - revision = "0e6baecebbf8a24a6590d3fc8232165008d6e5d8" + revision = "fb88fb9443665485a7172e8b6277dddcb2645e32" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "c381ad5f60ee516c2a6e4f90cdd5c6821321525e84a39d135a049863c6658f08" + inputs-digest = "1f1e965109a0b8b918b0aeccca046fc1a2ba6a41a1121a983f01deaccc4b6b5c" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 7ed8e3c..14dad8d 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -22,5 +22,5 @@ [[constraint]] - branch = "master" - name = "github.com/savaki/jq" + branch = "rename-imports" + name = "github.com/gabesullice/jq" diff --git a/main.go b/main.go index a89c915..b54f69a 100644 --- a/main.go +++ b/main.go @@ -6,8 +6,13 @@ import ( "net/http/httputil" "net/url" "os" + "regexp" - "github.com/savaki/jq" + "github.com/gabesullice/jq" +) + +var ( + reArray = regexp.MustCompile(`^\s*\[\s*(\d+)(\s*:\s*(\d+))?\s*]\s*$`) ) type PushProcessor struct { @@ -45,7 +50,8 @@ func main() { ) log.Fatalln(http.ListenAndServe(":8080", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { var ops []jq.Op - for _, path := range os.Args[2:] { + for _, path := range r.Header["X-Push-Request"] { + log.Println(reArray.FindAllStringSubmatch(path, -1)) ops = append(ops, jq.Must(jq.Parse(path))) } backend.ServeHTTP(PushProcessor{ diff --git a/vendor/github.com/savaki/jq/.gitignore b/vendor/github.com/gabesullice/jq/.gitignore similarity index 100% rename from vendor/github.com/savaki/jq/.gitignore rename to vendor/github.com/gabesullice/jq/.gitignore diff --git a/vendor/github.com/savaki/jq/LICENSE b/vendor/github.com/gabesullice/jq/LICENSE similarity index 100% rename from vendor/github.com/savaki/jq/LICENSE rename to vendor/github.com/gabesullice/jq/LICENSE diff --git a/vendor/github.com/savaki/jq/README.md b/vendor/github.com/gabesullice/jq/README.md similarity index 100% rename from vendor/github.com/savaki/jq/README.md rename to vendor/github.com/gabesullice/jq/README.md diff --git a/vendor/github.com/savaki/jq/doc.go b/vendor/github.com/gabesullice/jq/doc.go similarity index 100% rename from vendor/github.com/savaki/jq/doc.go rename to vendor/github.com/gabesullice/jq/doc.go diff --git a/vendor/github.com/savaki/jq/op.go b/vendor/github.com/gabesullice/jq/op.go similarity index 82% rename from vendor/github.com/savaki/jq/op.go rename to vendor/github.com/gabesullice/jq/op.go index 7d92316..a6df26f 100644 --- a/vendor/github.com/savaki/jq/op.go +++ b/vendor/github.com/gabesullice/jq/op.go @@ -17,7 +17,7 @@ package jq import ( "strings" - "github.com/savaki/jq/scanner" + "github.com/gabesullice/jq/scanner" ) // Op defines a single transformation to be applied to a []byte @@ -81,3 +81,17 @@ func Range(from, to int) OpFunc { return scanner.FindRange(in, 0, from, to) } } + +// From extracts all elements from the array provided from the given index onward, inclusive +func From(from int) OpFunc { + return func(in []byte) ([]byte, error) { + return scanner.FindFrom(in, 0, from) + } +} + +// To extracts all elements from the array provided up to the given index, inclusive +func To(to int) OpFunc { + return func(in []byte) ([]byte, error) { + return scanner.FindTo(in, 0, to) + } +} diff --git a/vendor/github.com/savaki/jq/op_chain_test.go b/vendor/github.com/gabesullice/jq/op_chain_test.go similarity index 98% rename from vendor/github.com/savaki/jq/op_chain_test.go rename to vendor/github.com/gabesullice/jq/op_chain_test.go index 543cb30..b54c678 100644 --- a/vendor/github.com/savaki/jq/op_chain_test.go +++ b/vendor/github.com/gabesullice/jq/op_chain_test.go @@ -17,7 +17,7 @@ package jq_test import ( "testing" - "github.com/savaki/jq" + "github.com/gabesullice/jq" ) func BenchmarkChain(t *testing.B) { diff --git a/vendor/github.com/savaki/jq/op_dot_test.go b/vendor/github.com/gabesullice/jq/op_dot_test.go similarity index 98% rename from vendor/github.com/savaki/jq/op_dot_test.go rename to vendor/github.com/gabesullice/jq/op_dot_test.go index efb1a7e..30f56b8 100644 --- a/vendor/github.com/savaki/jq/op_dot_test.go +++ b/vendor/github.com/gabesullice/jq/op_dot_test.go @@ -17,7 +17,7 @@ package jq_test import ( "testing" - "github.com/savaki/jq" + "github.com/gabesullice/jq" ) func BenchmarkDot(t *testing.B) { diff --git a/vendor/github.com/savaki/jq/parse.go b/vendor/github.com/gabesullice/jq/parse.go similarity index 65% rename from vendor/github.com/savaki/jq/parse.go rename to vendor/github.com/gabesullice/jq/parse.go index 3c21e06..4c43b92 100644 --- a/vendor/github.com/savaki/jq/parse.go +++ b/vendor/github.com/gabesullice/jq/parse.go @@ -22,7 +22,7 @@ import ( ) var ( - reArray = regexp.MustCompile(`^\s*\[\s*(\d+)(\s*:\s*(\d+))?\s*]\s*$`) + reArray = regexp.MustCompile(`^\s*\[\s*(?:(\d+))?\s*(?:(:))?\s*(?:(\d+))?\s*\]\s*$`) ) // Must is a convenience method similar to template.Must @@ -57,26 +57,55 @@ func Parse(selector string) (Op, error) { } func parseArray(key string) (Op, bool) { - match := reArray.FindAllStringSubmatch(key, -1) - if len(match) != 1 { + match := FindIndices(key) + + if len(match) == 0 { return nil, false } - fromStr := match[0][1] - from, err := strconv.Atoi(fromStr) - if err != nil { - return nil, false + matches := match[0] + + if matches[1]+matches[2]+matches[3] == "" { + return From(0), true } - toStr := match[0][3] - if toStr == "" { - return Index(from), true + if matches[2] == "" { + idx, err := strconv.Atoi(matches[1]) + if err != nil { + return nil, false + } + return Index(idx), true } - to, err := strconv.Atoi(toStr) + if matches[1] == "" { + to, err := strconv.Atoi(matches[3]) + if err != nil { + return nil, false + } + return To(to), true + } + + if matches[3] == "" { + from, err := strconv.Atoi(matches[1]) + if err != nil { + return nil, false + } + return From(from), true + } + + from, err := strconv.Atoi(matches[1]) + if err != nil { + return nil, false + } + + to, err := strconv.Atoi(matches[3]) if err != nil { return nil, false } return Range(from, to), true } + +func FindIndices(key string) [][]string { + return reArray.FindAllStringSubmatch(key, -1) +} diff --git a/vendor/github.com/savaki/jq/parse_regexp_test.go b/vendor/github.com/gabesullice/jq/parse_regexp_test.go similarity index 100% rename from vendor/github.com/savaki/jq/parse_regexp_test.go rename to vendor/github.com/gabesullice/jq/parse_regexp_test.go diff --git a/vendor/github.com/savaki/jq/parse_test.go b/vendor/github.com/gabesullice/jq/parse_test.go similarity index 59% rename from vendor/github.com/savaki/jq/parse_test.go rename to vendor/github.com/gabesullice/jq/parse_test.go index fa78e38..5c49b2d 100644 --- a/vendor/github.com/savaki/jq/parse_test.go +++ b/vendor/github.com/gabesullice/jq/parse_test.go @@ -17,7 +17,7 @@ package jq_test import ( "testing" - "github.com/savaki/jq" + "github.com/gabesullice/jq" ) func TestParse(t *testing.T) { @@ -47,6 +47,21 @@ func TestParse(t *testing.T) { Op: ".[1:2]", Expected: `["b","c"]`, }, + "from": { + In: `["a","b","c","d"]`, + Op: ".[1:]", + Expected: `["b","c","d"]`, + }, + "to": { + In: `["a","b","c","d"]`, + Op: ".[:2]", + Expected: `["a","b","c"]`, + }, + "all": { + In: `["a","b","c","d"]`, + Op: ".[]", + Expected: `["a","b","c","d"]`, + }, "nested index": { In: `{"abc":"-","def":["a","b","c"]}`, Op: ".def.[1]", @@ -82,3 +97,47 @@ func TestParse(t *testing.T) { }) } } + +//func TestFindIndices(t *testing.T) { +// testCases := map[string]struct { +// In string +// Expect []string +// }{ +// "simple": { +// In: "[0]", +// Expect: []string{"0"}, +// }, +// "range": { +// In: "[0:1]", +// Expect: []string{"0"}, +// }, +// "from": { +// In: "[1:]", +// Expect: []string{"0"}, +// }, +// "to": { +// In: "[:1]", +// Expect: []string{"0"}, +// }, +// } +// for label, tc := range testCases { +// t.Run(label, func(t *testing.T) { +// matches := jq.FindIndices(tc.In) +// t.Logf("%#v", matches[0]) +// if len(matches) == 0 { +// t.Log("no matches") +// t.FailNow() +// } +// if len(matches[0]) != len(tc.Expect) { +// t.Log("count mismatch") +// t.FailNow() +// } +// for k, v := range tc.Expect { +// if v != matches[0][k] { +// t.Log("expected mismatch") +// t.FailNow() +// } +// } +// }) +// } +//} diff --git a/vendor/github.com/savaki/jq/scanner/any.go b/vendor/github.com/gabesullice/jq/scanner/any.go similarity index 100% rename from vendor/github.com/savaki/jq/scanner/any.go rename to vendor/github.com/gabesullice/jq/scanner/any.go diff --git a/vendor/github.com/savaki/jq/scanner/any_test.go b/vendor/github.com/gabesullice/jq/scanner/any_test.go similarity index 97% rename from vendor/github.com/savaki/jq/scanner/any_test.go rename to vendor/github.com/gabesullice/jq/scanner/any_test.go index 352011a..50140db 100644 --- a/vendor/github.com/savaki/jq/scanner/any_test.go +++ b/vendor/github.com/gabesullice/jq/scanner/any_test.go @@ -17,7 +17,7 @@ package scanner_test import ( "testing" - "github.com/savaki/jq/scanner" + "github.com/gabesullice/jq/scanner" ) func BenchmarkAny(t *testing.B) { diff --git a/vendor/github.com/savaki/jq/scanner/array.go b/vendor/github.com/gabesullice/jq/scanner/array.go similarity index 100% rename from vendor/github.com/savaki/jq/scanner/array.go rename to vendor/github.com/gabesullice/jq/scanner/array.go diff --git a/vendor/github.com/savaki/jq/scanner/array_test.go b/vendor/github.com/gabesullice/jq/scanner/array_test.go similarity index 97% rename from vendor/github.com/savaki/jq/scanner/array_test.go rename to vendor/github.com/gabesullice/jq/scanner/array_test.go index c0a99ab..8a30ae3 100644 --- a/vendor/github.com/savaki/jq/scanner/array_test.go +++ b/vendor/github.com/gabesullice/jq/scanner/array_test.go @@ -17,7 +17,7 @@ package scanner_test import ( "testing" - "github.com/savaki/jq/scanner" + "github.com/gabesullice/jq/scanner" ) func BenchmarkArray(t *testing.B) { diff --git a/vendor/github.com/savaki/jq/scanner/as.go b/vendor/github.com/gabesullice/jq/scanner/as.go similarity index 100% rename from vendor/github.com/savaki/jq/scanner/as.go rename to vendor/github.com/gabesullice/jq/scanner/as.go diff --git a/vendor/github.com/savaki/jq/scanner/as_array_test.go b/vendor/github.com/gabesullice/jq/scanner/as_array_test.go similarity index 98% rename from vendor/github.com/savaki/jq/scanner/as_array_test.go rename to vendor/github.com/gabesullice/jq/scanner/as_array_test.go index 77c20e5..bb97337 100644 --- a/vendor/github.com/savaki/jq/scanner/as_array_test.go +++ b/vendor/github.com/gabesullice/jq/scanner/as_array_test.go @@ -18,7 +18,7 @@ import ( "bytes" "testing" - "github.com/savaki/jq/scanner" + "github.com/gabesullice/jq/scanner" ) func BenchmarkAsArray(t *testing.B) { diff --git a/vendor/github.com/savaki/jq/scanner/bool.go b/vendor/github.com/gabesullice/jq/scanner/bool.go similarity index 100% rename from vendor/github.com/savaki/jq/scanner/bool.go rename to vendor/github.com/gabesullice/jq/scanner/bool.go diff --git a/vendor/github.com/savaki/jq/scanner/doc.go b/vendor/github.com/gabesullice/jq/scanner/doc.go similarity index 100% rename from vendor/github.com/savaki/jq/scanner/doc.go rename to vendor/github.com/gabesullice/jq/scanner/doc.go diff --git a/vendor/github.com/savaki/jq/scanner/err.go b/vendor/github.com/gabesullice/jq/scanner/err.go similarity index 100% rename from vendor/github.com/savaki/jq/scanner/err.go rename to vendor/github.com/gabesullice/jq/scanner/err.go diff --git a/vendor/github.com/gabesullice/jq/scanner/find_from.go b/vendor/github.com/gabesullice/jq/scanner/find_from.go new file mode 100644 index 0000000..a7c28d9 --- /dev/null +++ b/vendor/github.com/gabesullice/jq/scanner/find_from.go @@ -0,0 +1,71 @@ +// Copyright (c) 2016 Matt Ho +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package scanner + +// FindTo finds the elements of an array between the specified indexes; inclusive +func FindFrom(in []byte, pos, from int) ([]byte, error) { + pos, err := skipSpace(in, pos) + if err != nil { + return nil, err + } + + if v := in[pos]; v != '[' { + return nil, newError(pos, v) + } + pos++ + + idx := 0 + itemStart := pos + + for { + pos, err = skipSpace(in, pos) + if err != nil { + return nil, err + } + + if idx == from { + itemStart = pos + } + + // data + pos, err = Any(in, pos) + if err != nil { + return nil, err + } + + pos, err = skipSpace(in, pos) + if err != nil { + return nil, err + } + + switch in[pos] { + case ',': + pos++ + case ']': + if idx < from { + return nil, errFromOutOfBounds + } + + data := in[itemStart:pos] + result := make([]byte, 0, len(data)+2) + result = append(result, '[') + result = append(result, data...) + result = append(result, ']') + return result, nil + } + + idx++ + } +} diff --git a/vendor/github.com/gabesullice/jq/scanner/find_from_test.go b/vendor/github.com/gabesullice/jq/scanner/find_from_test.go new file mode 100644 index 0000000..becbb21 --- /dev/null +++ b/vendor/github.com/gabesullice/jq/scanner/find_from_test.go @@ -0,0 +1,74 @@ +// Copyright (c) 2016 Matt Ho +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package scanner_test + +import ( + "testing" + + "github.com/gabesullice/jq/scanner" +) + +func TestFindFrom(t *testing.T) { + testCases := map[string]struct { + In string + From int + Expected string + HasErr bool + }{ + "all": { + In: `["a","b","c","d","e"]`, + From: 0, + Expected: `["a","b","c","d","e"]`, + }, + "last": { + In: `["a","b","c","d","e"]`, + From: 4, + Expected: `["e"]`, + }, + "middle": { + In: `["a","b","c","d","e"]`, + From: 2, + Expected: `["c","d","e"]`, + }, + "mixed": { + In: `["a",{"hello":"world"},"c","d","e"]`, + From: 0, + Expected: `["a",{"hello":"world"},"c","d","e"]`, + }, + "out of bounds": { + In: `["a",{"hello":"world"},"c","d","e"]`, + From: 20, + HasErr: true, + }, + } + + for label, tc := range testCases { + t.Run(label, func(t *testing.T) { + data, err := scanner.FindFrom([]byte(tc.In), 0, tc.From) + if tc.HasErr { + if err == nil { + t.FailNow() + } + } else { + if string(data) != tc.Expected { + t.FailNow() + } + if err != nil { + t.FailNow() + } + } + }) + } +} diff --git a/vendor/github.com/savaki/jq/scanner/find_index.go b/vendor/github.com/gabesullice/jq/scanner/find_index.go similarity index 100% rename from vendor/github.com/savaki/jq/scanner/find_index.go rename to vendor/github.com/gabesullice/jq/scanner/find_index.go diff --git a/vendor/github.com/savaki/jq/scanner/find_index_test.go b/vendor/github.com/gabesullice/jq/scanner/find_index_test.go similarity index 97% rename from vendor/github.com/savaki/jq/scanner/find_index_test.go rename to vendor/github.com/gabesullice/jq/scanner/find_index_test.go index ed6dbee..00a706a 100644 --- a/vendor/github.com/savaki/jq/scanner/find_index_test.go +++ b/vendor/github.com/gabesullice/jq/scanner/find_index_test.go @@ -17,7 +17,7 @@ package scanner_test import ( "testing" - "github.com/savaki/jq/scanner" + "github.com/gabesullice/jq/scanner" ) func BenchmarkFindIndex(t *testing.B) { diff --git a/vendor/github.com/savaki/jq/scanner/find_key.go b/vendor/github.com/gabesullice/jq/scanner/find_key.go similarity index 100% rename from vendor/github.com/savaki/jq/scanner/find_key.go rename to vendor/github.com/gabesullice/jq/scanner/find_key.go diff --git a/vendor/github.com/savaki/jq/scanner/find_key_test.go b/vendor/github.com/gabesullice/jq/scanner/find_key_test.go similarity index 97% rename from vendor/github.com/savaki/jq/scanner/find_key_test.go rename to vendor/github.com/gabesullice/jq/scanner/find_key_test.go index 0c1a1be..3b99548 100644 --- a/vendor/github.com/savaki/jq/scanner/find_key_test.go +++ b/vendor/github.com/gabesullice/jq/scanner/find_key_test.go @@ -17,7 +17,7 @@ package scanner_test import ( "testing" - "github.com/savaki/jq/scanner" + "github.com/gabesullice/jq/scanner" ) func BenchmarkFindKey(t *testing.B) { diff --git a/vendor/github.com/savaki/jq/scanner/find_range.go b/vendor/github.com/gabesullice/jq/scanner/find_range.go similarity index 100% rename from vendor/github.com/savaki/jq/scanner/find_range.go rename to vendor/github.com/gabesullice/jq/scanner/find_range.go diff --git a/vendor/github.com/savaki/jq/scanner/find_range_test.go b/vendor/github.com/gabesullice/jq/scanner/find_range_test.go similarity index 98% rename from vendor/github.com/savaki/jq/scanner/find_range_test.go rename to vendor/github.com/gabesullice/jq/scanner/find_range_test.go index c2b7887..78b3c2b 100644 --- a/vendor/github.com/savaki/jq/scanner/find_range_test.go +++ b/vendor/github.com/gabesullice/jq/scanner/find_range_test.go @@ -17,7 +17,7 @@ package scanner_test import ( "testing" - "github.com/savaki/jq/scanner" + "github.com/gabesullice/jq/scanner" ) func BenchmarkFindRange(t *testing.B) { diff --git a/vendor/github.com/gabesullice/jq/scanner/find_to.go b/vendor/github.com/gabesullice/jq/scanner/find_to.go new file mode 100644 index 0000000..4d85fe9 --- /dev/null +++ b/vendor/github.com/gabesullice/jq/scanner/find_to.go @@ -0,0 +1,67 @@ +// Copyright (c) 2016 Matt Ho +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package scanner + +// FindTo finds the elements of an array between the specified indexes; inclusive +func FindTo(in []byte, pos, to int) ([]byte, error) { + pos, err := skipSpace(in, pos) + if err != nil { + return nil, err + } + + if v := in[pos]; v != '[' { + return nil, newError(pos, v) + } + pos++ + + idx := 0 + itemStart := pos + + for { + pos, err = skipSpace(in, pos) + if err != nil { + return nil, err + } + + // data + pos, err = Any(in, pos) + if err != nil { + return nil, err + } + + if idx == to { + data := in[itemStart:pos] + result := make([]byte, 0, len(data)+2) + result = append(result, '[') + result = append(result, data...) + result = append(result, ']') + return result, nil + } + + pos, err = skipSpace(in, pos) + if err != nil { + return nil, err + } + + switch in[pos] { + case ',': + pos++ + case ']': + return nil, errIndexOutOfBounds + } + + idx++ + } +} diff --git a/vendor/github.com/gabesullice/jq/scanner/find_to_test.go b/vendor/github.com/gabesullice/jq/scanner/find_to_test.go new file mode 100644 index 0000000..2b0783b --- /dev/null +++ b/vendor/github.com/gabesullice/jq/scanner/find_to_test.go @@ -0,0 +1,74 @@ +// Copyright (c) 2016 Matt Ho +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package scanner_test + +import ( + "testing" + + "github.com/gabesullice/jq/scanner" +) + +func TestFindTo(t *testing.T) { + testCases := map[string]struct { + In string + To int + Expected string + HasErr bool + }{ + "first": { + In: `["a","b","c","d","e"]`, + To: 0, + Expected: `["a"]`, + }, + "second": { + In: `["a","b","c","d","e"]`, + To: 1, + Expected: `["a","b"]`, + }, + "mixed": { + In: `["a",{"hello":"world"},"c","d","e"]`, + To: 1, + Expected: `["a",{"hello":"world"}]`, + }, + "negative": { + In: `["a",{"hello":"world"},"c","d","e"]`, + To: -1, + HasErr: true, + }, + "out of bounds": { + In: `["a",{"hello":"world"},"c","d","e"]`, + To: 20, + HasErr: true, + }, + } + + for label, tc := range testCases { + t.Run(label, func(t *testing.T) { + data, err := scanner.FindTo([]byte(tc.In), 0, tc.To) + if tc.HasErr { + if err == nil { + t.FailNow() + } + } else { + if string(data) != tc.Expected { + t.FailNow() + } + if err != nil { + t.FailNow() + } + } + }) + } +} diff --git a/vendor/github.com/savaki/jq/scanner/null.go b/vendor/github.com/gabesullice/jq/scanner/null.go similarity index 100% rename from vendor/github.com/savaki/jq/scanner/null.go rename to vendor/github.com/gabesullice/jq/scanner/null.go diff --git a/vendor/github.com/savaki/jq/scanner/null_test.go b/vendor/github.com/gabesullice/jq/scanner/null_test.go similarity index 95% rename from vendor/github.com/savaki/jq/scanner/null_test.go rename to vendor/github.com/gabesullice/jq/scanner/null_test.go index c3a8f81..ea6cc7c 100644 --- a/vendor/github.com/savaki/jq/scanner/null_test.go +++ b/vendor/github.com/gabesullice/jq/scanner/null_test.go @@ -17,7 +17,7 @@ package scanner_test import ( "testing" - "github.com/savaki/jq/scanner" + "github.com/gabesullice/jq/scanner" ) func BenchmarkNull(t *testing.B) { diff --git a/vendor/github.com/savaki/jq/scanner/number.go b/vendor/github.com/gabesullice/jq/scanner/number.go similarity index 100% rename from vendor/github.com/savaki/jq/scanner/number.go rename to vendor/github.com/gabesullice/jq/scanner/number.go diff --git a/vendor/github.com/savaki/jq/scanner/number_test.go b/vendor/github.com/gabesullice/jq/scanner/number_test.go similarity index 97% rename from vendor/github.com/savaki/jq/scanner/number_test.go rename to vendor/github.com/gabesullice/jq/scanner/number_test.go index f0d9540..999c0e7 100644 --- a/vendor/github.com/savaki/jq/scanner/number_test.go +++ b/vendor/github.com/gabesullice/jq/scanner/number_test.go @@ -17,7 +17,7 @@ package scanner_test import ( "testing" - "github.com/savaki/jq/scanner" + "github.com/gabesullice/jq/scanner" ) func BenchmarkNumber(t *testing.B) { diff --git a/vendor/github.com/savaki/jq/scanner/object.go b/vendor/github.com/gabesullice/jq/scanner/object.go similarity index 100% rename from vendor/github.com/savaki/jq/scanner/object.go rename to vendor/github.com/gabesullice/jq/scanner/object.go diff --git a/vendor/github.com/savaki/jq/scanner/object_test.go b/vendor/github.com/gabesullice/jq/scanner/object_test.go similarity index 97% rename from vendor/github.com/savaki/jq/scanner/object_test.go rename to vendor/github.com/gabesullice/jq/scanner/object_test.go index 1f87399..30e7f88 100644 --- a/vendor/github.com/savaki/jq/scanner/object_test.go +++ b/vendor/github.com/gabesullice/jq/scanner/object_test.go @@ -17,7 +17,7 @@ package scanner_test import ( "testing" - "github.com/savaki/jq/scanner" + "github.com/gabesullice/jq/scanner" ) func BenchmarkObject(t *testing.B) { diff --git a/vendor/github.com/savaki/jq/scanner/string.go b/vendor/github.com/gabesullice/jq/scanner/string.go similarity index 100% rename from vendor/github.com/savaki/jq/scanner/string.go rename to vendor/github.com/gabesullice/jq/scanner/string.go diff --git a/vendor/github.com/savaki/jq/scanner/string_test.go b/vendor/github.com/gabesullice/jq/scanner/string_test.go similarity index 98% rename from vendor/github.com/savaki/jq/scanner/string_test.go rename to vendor/github.com/gabesullice/jq/scanner/string_test.go index fcce039..2ca8097 100644 --- a/vendor/github.com/savaki/jq/scanner/string_test.go +++ b/vendor/github.com/gabesullice/jq/scanner/string_test.go @@ -18,7 +18,7 @@ import ( "testing" "unicode/utf8" - "github.com/savaki/jq/scanner" + "github.com/gabesullice/jq/scanner" ) func BenchmarkString(t *testing.B) { diff --git a/vendor/github.com/savaki/jq/scanner/util.go b/vendor/github.com/gabesullice/jq/scanner/util.go similarity index 96% rename from vendor/github.com/savaki/jq/scanner/util.go rename to vendor/github.com/gabesullice/jq/scanner/util.go index 0ab36d2..3841598 100644 --- a/vendor/github.com/savaki/jq/scanner/util.go +++ b/vendor/github.com/gabesullice/jq/scanner/util.go @@ -26,6 +26,7 @@ var ( errKeyNotFound = errors.New("key not found") errIndexOutOfBounds = errors.New("index out of bounds") errToLessThanFrom = errors.New("to index less than from index") + errFromOutOfBounds = errors.New("from index out of bounds") errUnexpectedValue = errors.New("unexpected value") ) diff --git a/vendor/github.com/savaki/jq/scanner/util_test.go b/vendor/github.com/gabesullice/jq/scanner/util_test.go similarity index 100% rename from vendor/github.com/savaki/jq/scanner/util_test.go rename to vendor/github.com/gabesullice/jq/scanner/util_test.go