diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 538cb59b..32a9ae3d 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -10,10 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.18 + - name: Set up Go 1.19 uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 id: go - name: Check out code into the Go module directory diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2936b75c..86296c16 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: '^1.18' + go-version: '^1.19' - name: Compile man page markup id: gen-man-page-md run: | diff --git a/.gitignore b/.gitignore index 43bb095c..b159f65d 100644 --- a/.gitignore +++ b/.gitignore @@ -59,4 +59,6 @@ debian/files /.idea # vscode -.vscode \ No newline at end of file +.vscode + +yq3 diff --git a/go.mod b/go.mod index ba720e59..39d38226 100644 --- a/go.mod +++ b/go.mod @@ -27,4 +27,4 @@ require ( golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect ) -go 1.18 +go 1.19 diff --git a/pkg/yqlib/csv_test.go b/pkg/yqlib/csv_test.go index ff232ad0..d58b43e2 100644 --- a/pkg/yqlib/csv_test.go +++ b/pkg/yqlib/csv_test.go @@ -150,7 +150,7 @@ func testCSVScenario(t *testing.T, s formatScenario) { } } -func documentCSVDecodeObjectScenario(t *testing.T, w *bufio.Writer, s formatScenario, formatType string) { +func documentCSVDecodeObjectScenario(w *bufio.Writer, s formatScenario, formatType string) { writeOrPanic(w, fmt.Sprintf("## %v\n", s.description)) if s.subdescription != "" { @@ -250,9 +250,9 @@ func documentCSVScenario(t *testing.T, w *bufio.Writer, i interface{}) { case "encode-tsv": documentCSVEncodeScenario(w, s, "tsv") case "decode-csv-object": - documentCSVDecodeObjectScenario(t, w, s, "csv") + documentCSVDecodeObjectScenario(w, s, "csv") case "decode-tsv-object": - documentCSVDecodeObjectScenario(t, w, s, "tsv") + documentCSVDecodeObjectScenario(w, s, "tsv") case "roundtrip-csv": documentCSVRoundTripScenario(w, s, "csv") diff --git a/pkg/yqlib/lib.go b/pkg/yqlib/lib.go index 3e3147b4..d4823dd2 100644 --- a/pkg/yqlib/lib.go +++ b/pkg/yqlib/lib.go @@ -1,5 +1,4 @@ // Use the top level Evaluator or StreamEvaluator to evaluate expressions and return matches. -// package yqlib import ( @@ -80,7 +79,7 @@ var notEqualsOpType = &operationType{Type: "NOT_EQUALS", NumArgs: 2, Precedence: var compareOpType = &operationType{Type: "COMPARE", NumArgs: 2, Precedence: 40, Handler: compareOperator} -//createmap needs to be above union, as we use union to build the components of the objects +// createmap needs to be above union, as we use union to build the components of the objects var createMapOpType = &operationType{Type: "CREATE_MAP", NumArgs: 2, Precedence: 15, Handler: createMapOperator} var shortPipeOpType = &operationType{Type: "SHORT_PIPE", NumArgs: 2, Precedence: 45, Handler: pipeOperator} @@ -431,7 +430,7 @@ func (p *Operation) toString() string { } } -//use for debugging only +// use for debugging only func NodesToString(collection *list.List) string { if !log.IsEnabledFor(logging.DEBUG) { return "" diff --git a/pkg/yqlib/operator_create_map.go b/pkg/yqlib/operator_create_map.go index d5ca9954..84582c9e 100644 --- a/pkg/yqlib/operator_create_map.go +++ b/pkg/yqlib/operator_create_map.go @@ -72,7 +72,7 @@ func sequenceFor(d *dataTreeNavigator, context Context, matchingNode *CandidateN return &CandidateNode{Node: innerList, Document: document, Path: path}, nil } -//NOTE: here the document index gets dropped so we +// NOTE: here the document index gets dropped so we // no longer know where the node originates from. func listToNodeSeq(list *list.List) *yaml.Node { node := yaml.Node{Kind: yaml.SequenceNode, Tag: "!!seq"} diff --git a/pkg/yqlib/operator_encoder_decoder_test.go b/pkg/yqlib/operator_encoder_decoder_test.go index 5b5726f0..91057b5e 100644 --- a/pkg/yqlib/operator_encoder_decoder_test.go +++ b/pkg/yqlib/operator_encoder_decoder_test.go @@ -81,8 +81,8 @@ var encoderDecoderOperatorScenarios = []expressionScenario{ }, { description: "Decode tsv encoded string", - document: `a: "cats dogs\ngreat cool as well"`, - expression: `.a |= @tsvd`, + document: `a: "cats dogs\ngreat cool as well"`, + expression: `.a |= @tsvd`, expected: []string{ "D0, P[], (doc)::a:\n - cats: great\n dogs: cool as well\n", }, diff --git a/pkg/yqlib/operator_sort.go b/pkg/yqlib/operator_sort.go index a14e8a14..5dfff494 100644 --- a/pkg/yqlib/operator_sort.go +++ b/pkg/yqlib/operator_sort.go @@ -17,7 +17,7 @@ func sortOperator(d *dataTreeNavigator, context Context, expressionNode *Express } // context represents the current matching nodes in the expression pipeline -//expressionNode is your current expression (sort_by) +// expressionNode is your current expression (sort_by) func sortByOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { results := list.New() diff --git a/scripts/devtools.sh b/scripts/devtools.sh index 278bcc7d..d9feeedd 100755 --- a/scripts/devtools.sh +++ b/scripts/devtools.sh @@ -1,5 +1,5 @@ #!/bin/sh set -ex go mod download golang.org/x/tools@latest -curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.45.2 -wget -O- -nv https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s v2.11.0 +curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.49.0 +wget -O- -nv https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s v2.13.1 diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 8b18407f..88ee1e4c 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -16,7 +16,7 @@ apps: parts: yq: plugin: go - go-channel: 1.18/stable + go-channel: 1.19/stable source: . source-type: git go-importpath: github.com/mikefarah/yq