From fae2b2643cb44bc48360dcea189191282c878857 Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Tue, 1 Jun 2021 10:52:14 +1000 Subject: [PATCH] Added gofmt to format command --- pkg/yqlib/operator_traverse_path.go | 2 +- scripts/format.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/yqlib/operator_traverse_path.go b/pkg/yqlib/operator_traverse_path.go index d0cb1ec0..98ba5356 100644 --- a/pkg/yqlib/operator_traverse_path.go +++ b/pkg/yqlib/operator_traverse_path.go @@ -308,6 +308,6 @@ func traverseMergeAnchor(newMatches *orderedmap.OrderedMap, originalCandidate *C func traverseArray(candidate *CandidateNode, operation *Operation, prefs traversePreferences) (*list.List, error) { log.Debug("operation Value %v", operation.Value) - indices := []*yaml.Node{&yaml.Node{Value: operation.StringValue}} + indices := []*yaml.Node{{Value: operation.StringValue}} return traverseArrayWithIndices(candidate, indices, prefs) } diff --git a/scripts/format.sh b/scripts/format.sh index eca4b063..0a11c952 100755 --- a/scripts/format.sh +++ b/scripts/format.sh @@ -1,5 +1,6 @@ #!/bin/bash find . \( -path ./vendor \) -prune -o -name "*.go" -exec goimports -w {} \; +gofmt -w -s . go mod tidy -go mod vendor \ No newline at end of file +go mod vendor