From 010750daf643a5a4d4e0292259990534dae2fb5d Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Thu, 11 Jan 2024 13:17:34 +1100 Subject: [PATCH] Updated to latest golint --- .golangci.yml | 15 +++++++++------ pkg/yqlib/csv_test.go | 2 +- pkg/yqlib/encoder_base64.go | 4 ++-- pkg/yqlib/encoder_csv.go | 4 ++-- pkg/yqlib/encoder_json.go | 4 ++-- pkg/yqlib/encoder_lua.go | 4 ++-- pkg/yqlib/encoder_properties.go | 2 +- pkg/yqlib/encoder_sh.go | 4 ++-- pkg/yqlib/encoder_toml.go | 4 ++-- pkg/yqlib/encoder_uri.go | 4 ++-- pkg/yqlib/encoder_xml.go | 6 +++--- pkg/yqlib/lexer.go | 3 +-- pkg/yqlib/lib.go | 3 +-- pkg/yqlib/lua_test.go | 2 +- pkg/yqlib/operator_add.go | 2 +- pkg/yqlib/operator_alternative.go | 2 +- pkg/yqlib/operator_anchors_aliases.go | 4 ++-- pkg/yqlib/operator_booleans.go | 4 ++-- pkg/yqlib/operator_collect_object.go | 2 +- pkg/yqlib/operator_column.go | 2 +- pkg/yqlib/operator_comments.go | 2 +- pkg/yqlib/operator_contains.go | 2 +- pkg/yqlib/operator_datetime.go | 6 +++--- pkg/yqlib/operator_divide.go | 2 +- pkg/yqlib/operator_document_index.go | 2 +- pkg/yqlib/operator_encoder_decoder.go | 4 ++-- pkg/yqlib/operator_entries.go | 4 ++-- pkg/yqlib/operator_env.go | 4 ++-- pkg/yqlib/operator_file.go | 4 ++-- pkg/yqlib/operator_flatten.go | 2 +- pkg/yqlib/operator_keys.go | 6 +++--- pkg/yqlib/operator_kind.go | 2 +- pkg/yqlib/operator_length.go | 2 +- pkg/yqlib/operator_line.go | 2 +- pkg/yqlib/operator_load.go | 11 +++++------ pkg/yqlib/operator_modulo.go | 2 +- pkg/yqlib/operator_parent.go | 2 +- pkg/yqlib/operator_path.go | 2 +- pkg/yqlib/operator_recursive_descent.go | 2 +- pkg/yqlib/operator_reverse.go | 2 +- pkg/yqlib/operator_self.go | 2 +- pkg/yqlib/operator_shuffle.go | 2 +- pkg/yqlib/operator_split_document.go | 2 +- pkg/yqlib/operator_strings.go | 4 ++-- pkg/yqlib/operator_style.go | 2 +- pkg/yqlib/operator_subtract.go | 2 +- pkg/yqlib/operator_tag.go | 2 +- pkg/yqlib/operator_to_number.go | 2 +- pkg/yqlib/operator_traverse_path.go | 2 +- pkg/yqlib/operator_unique.go | 2 +- pkg/yqlib/operator_value.go | 4 ++-- pkg/yqlib/operator_variables.go | 4 ++-- pkg/yqlib/operators.go | 2 +- pkg/yqlib/operators_test.go | 2 +- pkg/yqlib/printer_writer.go | 2 +- pkg/yqlib/properties_test.go | 2 +- pkg/yqlib/toml_test.go | 2 +- pkg/yqlib/xml_test.go | 2 +- project-words.txt | 3 ++- scripts/devtools.sh | 2 +- 60 files changed, 95 insertions(+), 94 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 84642b69..1476b6cc 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -20,12 +20,15 @@ linters: - unparam linters-settings: depguard: - list-type: blacklist - include-go-root: true - packages: - - io/ioutil - packages-with-error-message: - - io/ioutil: "The 'io/ioutil' package is deprecated. Use corresponding 'os' or 'io' functions instead." + rules: + prevent_unmaintained_packages: + list-mode: lax + files: + - $all + - "!$test" + deny: + - pkg: io/ioutil + desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil" issues: exclude-rules: - linters: diff --git a/pkg/yqlib/csv_test.go b/pkg/yqlib/csv_test.go index 66bc5de7..c8e7e16d 100644 --- a/pkg/yqlib/csv_test.go +++ b/pkg/yqlib/csv_test.go @@ -272,7 +272,7 @@ func documentCSVRoundTripScenario(w *bufio.Writer, s formatScenario, formatType ) } -func documentCSVScenario(t *testing.T, w *bufio.Writer, i interface{}) { +func documentCSVScenario(_ *testing.T, w *bufio.Writer, i interface{}) { s := i.(formatScenario) if s.skipDoc { return diff --git a/pkg/yqlib/encoder_base64.go b/pkg/yqlib/encoder_base64.go index 9d7f126d..0b98a733 100644 --- a/pkg/yqlib/encoder_base64.go +++ b/pkg/yqlib/encoder_base64.go @@ -18,11 +18,11 @@ func (e *base64Encoder) CanHandleAliases() bool { return false } -func (e *base64Encoder) PrintDocumentSeparator(writer io.Writer) error { +func (e *base64Encoder) PrintDocumentSeparator(_ io.Writer) error { return nil } -func (e *base64Encoder) PrintLeadingContent(writer io.Writer, content string) error { +func (e *base64Encoder) PrintLeadingContent(_ io.Writer, _ string) error { return nil } diff --git a/pkg/yqlib/encoder_csv.go b/pkg/yqlib/encoder_csv.go index 7904d728..aaea60c6 100644 --- a/pkg/yqlib/encoder_csv.go +++ b/pkg/yqlib/encoder_csv.go @@ -18,11 +18,11 @@ func (e *csvEncoder) CanHandleAliases() bool { return false } -func (e *csvEncoder) PrintDocumentSeparator(writer io.Writer) error { +func (e *csvEncoder) PrintDocumentSeparator(_ io.Writer) error { return nil } -func (e *csvEncoder) PrintLeadingContent(writer io.Writer, content string) error { +func (e *csvEncoder) PrintLeadingContent(_ io.Writer, _ string) error { return nil } diff --git a/pkg/yqlib/encoder_json.go b/pkg/yqlib/encoder_json.go index 31c7b580..d6011b43 100644 --- a/pkg/yqlib/encoder_json.go +++ b/pkg/yqlib/encoder_json.go @@ -29,11 +29,11 @@ func (je *jsonEncoder) CanHandleAliases() bool { return false } -func (je *jsonEncoder) PrintDocumentSeparator(writer io.Writer) error { +func (je *jsonEncoder) PrintDocumentSeparator(_ io.Writer) error { return nil } -func (je *jsonEncoder) PrintLeadingContent(writer io.Writer, content string) error { +func (je *jsonEncoder) PrintLeadingContent(_ io.Writer, _ string) error { return nil } diff --git a/pkg/yqlib/encoder_lua.go b/pkg/yqlib/encoder_lua.go index b600371d..6fa85a57 100644 --- a/pkg/yqlib/encoder_lua.go +++ b/pkg/yqlib/encoder_lua.go @@ -72,11 +72,11 @@ func NewLuaEncoder(prefs LuaPreferences) Encoder { return &luaEncoder{unescape.Replace(prefs.DocPrefix), unescape.Replace(prefs.DocSuffix), 0, "\t", prefs.UnquotedKeys, prefs.Globals, escape} } -func (le *luaEncoder) PrintDocumentSeparator(writer io.Writer) error { +func (le *luaEncoder) PrintDocumentSeparator(_ io.Writer) error { return nil } -func (le *luaEncoder) PrintLeadingContent(writer io.Writer, content string) error { +func (le *luaEncoder) PrintLeadingContent(_ io.Writer, _ string) error { return nil } diff --git a/pkg/yqlib/encoder_properties.go b/pkg/yqlib/encoder_properties.go index 0ebfb28a..74826fd8 100644 --- a/pkg/yqlib/encoder_properties.go +++ b/pkg/yqlib/encoder_properties.go @@ -24,7 +24,7 @@ func (pe *propertiesEncoder) CanHandleAliases() bool { return false } -func (pe *propertiesEncoder) PrintDocumentSeparator(writer io.Writer) error { +func (pe *propertiesEncoder) PrintDocumentSeparator(_ io.Writer) error { return nil } diff --git a/pkg/yqlib/encoder_sh.go b/pkg/yqlib/encoder_sh.go index 3c540399..42b73eca 100644 --- a/pkg/yqlib/encoder_sh.go +++ b/pkg/yqlib/encoder_sh.go @@ -21,11 +21,11 @@ func (e *shEncoder) CanHandleAliases() bool { return false } -func (e *shEncoder) PrintDocumentSeparator(writer io.Writer) error { +func (e *shEncoder) PrintDocumentSeparator(_ io.Writer) error { return nil } -func (e *shEncoder) PrintLeadingContent(writer io.Writer, content string) error { +func (e *shEncoder) PrintLeadingContent(_ io.Writer, _ string) error { return nil } diff --git a/pkg/yqlib/encoder_toml.go b/pkg/yqlib/encoder_toml.go index 44e4e8b5..f8ced30f 100644 --- a/pkg/yqlib/encoder_toml.go +++ b/pkg/yqlib/encoder_toml.go @@ -19,11 +19,11 @@ func (te *tomlEncoder) Encode(writer io.Writer, node *CandidateNode) error { return fmt.Errorf("only scalars (e.g. strings, numbers, booleans) are supported for TOML output at the moment. Please use yaml output format (-oy) until the encoder has been fully implemented") } -func (te *tomlEncoder) PrintDocumentSeparator(writer io.Writer) error { +func (te *tomlEncoder) PrintDocumentSeparator(_ io.Writer) error { return nil } -func (te *tomlEncoder) PrintLeadingContent(writer io.Writer, content string) error { +func (te *tomlEncoder) PrintLeadingContent(_ io.Writer, _ string) error { return nil } diff --git a/pkg/yqlib/encoder_uri.go b/pkg/yqlib/encoder_uri.go index 194350c4..86bcc11a 100644 --- a/pkg/yqlib/encoder_uri.go +++ b/pkg/yqlib/encoder_uri.go @@ -17,11 +17,11 @@ func (e *uriEncoder) CanHandleAliases() bool { return false } -func (e *uriEncoder) PrintDocumentSeparator(writer io.Writer) error { +func (e *uriEncoder) PrintDocumentSeparator(_ io.Writer) error { return nil } -func (e *uriEncoder) PrintLeadingContent(writer io.Writer, content string) error { +func (e *uriEncoder) PrintLeadingContent(_ io.Writer, _ string) error { return nil } diff --git a/pkg/yqlib/encoder_xml.go b/pkg/yqlib/encoder_xml.go index 1d55d902..8212c58e 100644 --- a/pkg/yqlib/encoder_xml.go +++ b/pkg/yqlib/encoder_xml.go @@ -30,11 +30,11 @@ func (e *xmlEncoder) CanHandleAliases() bool { return false } -func (e *xmlEncoder) PrintDocumentSeparator(writer io.Writer) error { +func (e *xmlEncoder) PrintDocumentSeparator(_ io.Writer) error { return nil } -func (e *xmlEncoder) PrintLeadingContent(writer io.Writer, content string) error { +func (e *xmlEncoder) PrintLeadingContent(_ io.Writer, content string) error { e.leadingContent = content return nil } @@ -122,7 +122,7 @@ func (e *xmlEncoder) encodeTopLevelMap(encoder *xml.Encoder, node *CandidateNode } } - if key.Value == (e.prefs.ProcInstPrefix + "xml") { + if key.Value == (e.prefs.ProcInstPrefix + "xml") { //nolint // dont double process these. } else if strings.HasPrefix(key.Value, e.prefs.ProcInstPrefix) { name := strings.Replace(key.Value, e.prefs.ProcInstPrefix, "", 1) diff --git a/pkg/yqlib/lexer.go b/pkg/yqlib/lexer.go index d118fa0f..77709b7b 100644 --- a/pkg/yqlib/lexer.go +++ b/pkg/yqlib/lexer.go @@ -51,9 +51,8 @@ func (t *token) toString(detail bool) string { } else if t.TokenType == traverseArrayCollect { return ".[" - } else { - return "NFI" } + return "NFI" } func unwrap(value string) string { diff --git a/pkg/yqlib/lib.go b/pkg/yqlib/lib.go index f3f127b5..7d56a53a 100644 --- a/pkg/yqlib/lib.go +++ b/pkg/yqlib/lib.go @@ -357,9 +357,8 @@ func (p *Operation) toString() string { return "SELF" } else if p.OperationType == valueOpType { return fmt.Sprintf("%v (%T)", p.Value, p.Value) - } else { - return fmt.Sprintf("%v", p.OperationType.Type) } + return fmt.Sprintf("%v", p.OperationType.Type) } // use for debugging only diff --git a/pkg/yqlib/lua_test.go b/pkg/yqlib/lua_test.go index 6e0bc8b6..a3387c5a 100644 --- a/pkg/yqlib/lua_test.go +++ b/pkg/yqlib/lua_test.go @@ -277,7 +277,7 @@ func testLuaScenario(t *testing.T, s formatScenario) { } } -func documentLuaScenario(t *testing.T, w *bufio.Writer, i interface{}) { +func documentLuaScenario(_ *testing.T, w *bufio.Writer, i interface{}) { s := i.(formatScenario) if s.skipDoc { diff --git a/pkg/yqlib/operator_add.go b/pkg/yqlib/operator_add.go index 611dfa20..6f2322bc 100644 --- a/pkg/yqlib/operator_add.go +++ b/pkg/yqlib/operator_add.go @@ -42,7 +42,7 @@ func addOperator(d *dataTreeNavigator, context Context, expressionNode *Expressi return crossFunction(d, context.ReadOnlyClone(), expressionNode, add, false) } -func add(d *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) { +func add(_ *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) { lhsNode := lhs if lhsNode.Tag == "!!null" { diff --git a/pkg/yqlib/operator_alternative.go b/pkg/yqlib/operator_alternative.go index 0069d4ff..0d05d04d 100644 --- a/pkg/yqlib/operator_alternative.go +++ b/pkg/yqlib/operator_alternative.go @@ -19,7 +19,7 @@ func alternativeOperator(d *dataTreeNavigator, context Context, expressionNode * return crossFunctionWithPrefs(d, context, expressionNode, prefs) } -func alternativeFunc(d *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) { +func alternativeFunc(_ *dataTreeNavigator, _ Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) { if lhs == nil { return rhs, nil } diff --git a/pkg/yqlib/operator_anchors_aliases.go b/pkg/yqlib/operator_anchors_aliases.go index d9d73754..81708997 100644 --- a/pkg/yqlib/operator_anchors_aliases.go +++ b/pkg/yqlib/operator_anchors_aliases.go @@ -48,7 +48,7 @@ func assignAliasOperator(d *dataTreeNavigator, context Context, expressionNode * return context, nil } -func getAliasOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func getAliasOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { log.Debugf("GetAlias operator!") var results = list.New() @@ -102,7 +102,7 @@ func assignAnchorOperator(d *dataTreeNavigator, context Context, expressionNode return context, nil } -func getAnchorOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func getAnchorOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { log.Debugf("GetAnchor operator!") var results = list.New() diff --git a/pkg/yqlib/operator_booleans.go b/pkg/yqlib/operator_booleans.go index 8fd41367..cf54134f 100644 --- a/pkg/yqlib/operator_booleans.go +++ b/pkg/yqlib/operator_booleans.go @@ -35,7 +35,7 @@ func getOwner(lhs *CandidateNode, rhs *CandidateNode) *CandidateNode { return owner } -func returnRhsTruthy(d *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) { +func returnRhsTruthy(_ *dataTreeNavigator, _ Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) { owner := getOwner(lhs, rhs) rhsBool := isTruthyNode(rhs) @@ -136,7 +136,7 @@ func andOperator(d *dataTreeNavigator, context Context, expressionNode *Expressi return crossFunctionWithPrefs(d, context.ReadOnlyClone(), expressionNode, prefs) } -func notOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func notOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { log.Debugf("-- notOperation") var results = list.New() diff --git a/pkg/yqlib/operator_collect_object.go b/pkg/yqlib/operator_collect_object.go index 4f2283ac..d0c54c9d 100644 --- a/pkg/yqlib/operator_collect_object.go +++ b/pkg/yqlib/operator_collect_object.go @@ -15,7 +15,7 @@ import ( ... */ -func collectObjectOperator(d *dataTreeNavigator, originalContext Context, expressionNode *ExpressionNode) (Context, error) { +func collectObjectOperator(d *dataTreeNavigator, originalContext Context, _ *ExpressionNode) (Context, error) { log.Debugf("-- collectObjectOperation") context := originalContext.WritableClone() diff --git a/pkg/yqlib/operator_column.go b/pkg/yqlib/operator_column.go index e4e92ba2..114288a3 100644 --- a/pkg/yqlib/operator_column.go +++ b/pkg/yqlib/operator_column.go @@ -5,7 +5,7 @@ import ( "fmt" ) -func columnOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func columnOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { log.Debugf("columnOperator") var results = list.New() diff --git a/pkg/yqlib/operator_comments.go b/pkg/yqlib/operator_comments.go index 60da4203..433d25d3 100644 --- a/pkg/yqlib/operator_comments.go +++ b/pkg/yqlib/operator_comments.go @@ -72,7 +72,7 @@ func assignCommentsOperator(d *dataTreeNavigator, context Context, expressionNod return context, nil } -func getCommentsOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func getCommentsOperator(_ *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { preferences := expressionNode.Operation.Preferences.(commentOpPreferences) var startCommentCharacterRegExp = regexp.MustCompile(`^# `) var subsequentCommentCharacterRegExp = regexp.MustCompile(`\n# `) diff --git a/pkg/yqlib/operator_contains.go b/pkg/yqlib/operator_contains.go index aa913d97..fa07d33f 100644 --- a/pkg/yqlib/operator_contains.go +++ b/pkg/yqlib/operator_contains.go @@ -92,7 +92,7 @@ func contains(lhs *CandidateNode, rhs *CandidateNode) (bool, error) { return false, fmt.Errorf("%v not yet supported for contains", lhs.Tag) } -func containsWithNodes(d *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) { +func containsWithNodes(_ *dataTreeNavigator, _ Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) { if lhs.Kind != rhs.Kind { return nil, fmt.Errorf("%v cannot check contained in %v", rhs.Tag, lhs.Tag) } diff --git a/pkg/yqlib/operator_datetime.go b/pkg/yqlib/operator_datetime.go index a5932c01..65a1acb2 100644 --- a/pkg/yqlib/operator_datetime.go +++ b/pkg/yqlib/operator_datetime.go @@ -37,7 +37,7 @@ func withDateTimeFormat(d *dataTreeNavigator, context Context, expressionNode *E // for unit tests var Now = time.Now -func nowOp(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func nowOp(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { node := &CandidateNode{ Tag: "!!timestamp", @@ -134,7 +134,7 @@ func parseUnixTime(unixTime string) (time.Time, error) { return time.UnixMilli(int64(seconds * 1000)), nil } -func fromUnixOp(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func fromUnixOp(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { var results = list.New() @@ -160,7 +160,7 @@ func fromUnixOp(d *dataTreeNavigator, context Context, expressionNode *Expressio return context.ChildContext(results), nil } -func toUnixOp(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func toUnixOp(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { layout := context.GetDateTimeLayout() diff --git a/pkg/yqlib/operator_divide.go b/pkg/yqlib/operator_divide.go index 5c412150..f0dc6841 100644 --- a/pkg/yqlib/operator_divide.go +++ b/pkg/yqlib/operator_divide.go @@ -12,7 +12,7 @@ func divideOperator(d *dataTreeNavigator, context Context, expressionNode *Expre return crossFunction(d, context.ReadOnlyClone(), expressionNode, divide, false) } -func divide(d *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) { +func divide(_ *dataTreeNavigator, _ Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) { if lhs.Tag == "!!null" { return nil, fmt.Errorf("%v (%v) cannot be divided by %v (%v)", lhs.Tag, lhs.GetNicePath(), rhs.Tag, rhs.GetNicePath()) } diff --git a/pkg/yqlib/operator_document_index.go b/pkg/yqlib/operator_document_index.go index 0f853d78..791d821e 100644 --- a/pkg/yqlib/operator_document_index.go +++ b/pkg/yqlib/operator_document_index.go @@ -5,7 +5,7 @@ import ( "fmt" ) -func getDocumentIndexOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func getDocumentIndexOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { var results = list.New() for el := context.MatchingNodes.Front(); el != nil; el = el.Next() { diff --git a/pkg/yqlib/operator_encoder_decoder.go b/pkg/yqlib/operator_encoder_decoder.go index 90c0dbef..e6a4eb84 100644 --- a/pkg/yqlib/operator_encoder_decoder.go +++ b/pkg/yqlib/operator_encoder_decoder.go @@ -54,7 +54,7 @@ type encoderPreferences struct { /* encodes object as yaml string */ -func encodeOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func encodeOperator(_ *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { preferences := expressionNode.Operation.Preferences.(encoderPreferences) var results = list.New() @@ -122,7 +122,7 @@ func createDecoder(format InputFormat) Decoder { } /* takes a string and decodes it back into an object */ -func decodeOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func decodeOperator(_ *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { preferences := expressionNode.Operation.Preferences.(decoderPreferences) diff --git a/pkg/yqlib/operator_entries.go b/pkg/yqlib/operator_entries.go index 3b193502..3434ed94 100644 --- a/pkg/yqlib/operator_entries.go +++ b/pkg/yqlib/operator_entries.go @@ -40,7 +40,7 @@ func toEntriesfromSeq(candidateNode *CandidateNode) *CandidateNode { return sequence } -func toEntriesOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func toEntriesOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { var results = list.New() for el := context.MatchingNodes.Front(); el != nil; el = el.Next() { candidate := el.Value.(*CandidateNode) @@ -102,7 +102,7 @@ func fromEntries(candidateNode *CandidateNode) (*CandidateNode, error) { return node, nil } -func fromEntriesOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func fromEntriesOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { var results = list.New() for el := context.MatchingNodes.Front(); el != nil; el = el.Next() { candidate := el.Value.(*CandidateNode) diff --git a/pkg/yqlib/operator_env.go b/pkg/yqlib/operator_env.go index 3ab10b24..d4ffa983 100644 --- a/pkg/yqlib/operator_env.go +++ b/pkg/yqlib/operator_env.go @@ -16,7 +16,7 @@ type envOpPreferences struct { FailFast bool } -func envOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func envOperator(_ *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { envName := expressionNode.Operation.CandidateNode.Value log.Debug("EnvOperator, env name:", envName) @@ -53,7 +53,7 @@ func envOperator(d *dataTreeNavigator, context Context, expressionNode *Expressi return context.SingleChildContext(node), nil } -func envsubstOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func envsubstOperator(_ *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { var results = list.New() preferences := envOpPreferences{} if expressionNode.Operation.Preferences != nil { diff --git a/pkg/yqlib/operator_file.go b/pkg/yqlib/operator_file.go index 29896719..b72644a5 100644 --- a/pkg/yqlib/operator_file.go +++ b/pkg/yqlib/operator_file.go @@ -5,7 +5,7 @@ import ( "fmt" ) -func getFilenameOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func getFilenameOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { log.Debugf("GetFilename") var results = list.New() @@ -19,7 +19,7 @@ func getFilenameOperator(d *dataTreeNavigator, context Context, expressionNode * return context.ChildContext(results), nil } -func getFileIndexOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func getFileIndexOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { log.Debugf("GetFileIndex") var results = list.New() diff --git a/pkg/yqlib/operator_flatten.go b/pkg/yqlib/operator_flatten.go index 011337e6..ddb360cf 100644 --- a/pkg/yqlib/operator_flatten.go +++ b/pkg/yqlib/operator_flatten.go @@ -32,7 +32,7 @@ func flatten(node *CandidateNode, depth int) { node.AddChildren(newSeq) } -func flattenOp(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func flattenOp(_ *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { log.Debugf("-- flatten Operator") depth := expressionNode.Operation.Preferences.(flattenPreferences).depth diff --git a/pkg/yqlib/operator_keys.go b/pkg/yqlib/operator_keys.go index bbb9a5d8..b4bff314 100644 --- a/pkg/yqlib/operator_keys.go +++ b/pkg/yqlib/operator_keys.go @@ -5,7 +5,7 @@ import ( "fmt" ) -func isKeyOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func isKeyOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { log.Debugf("-- isKeyOperator") var results = list.New() @@ -19,7 +19,7 @@ func isKeyOperator(d *dataTreeNavigator, context Context, expressionNode *Expres return context.ChildContext(results), nil } -func getKeyOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func getKeyOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { log.Debugf("-- getKeyOperator") var results = list.New() @@ -36,7 +36,7 @@ func getKeyOperator(d *dataTreeNavigator, context Context, expressionNode *Expre } -func keysOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func keysOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { log.Debugf("-- keysOperator") var results = list.New() diff --git a/pkg/yqlib/operator_kind.go b/pkg/yqlib/operator_kind.go index 1f15a9cf..1afdbb13 100644 --- a/pkg/yqlib/operator_kind.go +++ b/pkg/yqlib/operator_kind.go @@ -19,7 +19,7 @@ func kindToText(kind Kind) string { } } -func getKindOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func getKindOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { log.Debugf("GetKindOperator") var results = list.New() diff --git a/pkg/yqlib/operator_length.go b/pkg/yqlib/operator_length.go index 57c5377e..844aa96c 100644 --- a/pkg/yqlib/operator_length.go +++ b/pkg/yqlib/operator_length.go @@ -5,7 +5,7 @@ import ( "fmt" ) -func lengthOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func lengthOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { log.Debugf("-- lengthOperation") var results = list.New() diff --git a/pkg/yqlib/operator_line.go b/pkg/yqlib/operator_line.go index cb19f221..bba7ae10 100644 --- a/pkg/yqlib/operator_line.go +++ b/pkg/yqlib/operator_line.go @@ -5,7 +5,7 @@ import ( "fmt" ) -func lineOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func lineOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { log.Debugf("lineOperator") var results = list.New() diff --git a/pkg/yqlib/operator_load.go b/pkg/yqlib/operator_load.go index 8eeec303..8f0a5003 100644 --- a/pkg/yqlib/operator_load.go +++ b/pkg/yqlib/operator_load.go @@ -54,13 +54,12 @@ func loadYaml(filename string, decoder Decoder) (*CandidateNode, error) { candidate := documents.Front().Value.(*CandidateNode) return candidate, nil - } else { - sequenceNode := &CandidateNode{Kind: SequenceNode} - for doc := documents.Front(); doc != nil; doc = doc.Next() { - sequenceNode.AddChild(doc.Value.(*CandidateNode)) - } - return sequenceNode, nil } + sequenceNode := &CandidateNode{Kind: SequenceNode} + for doc := documents.Front(); doc != nil; doc = doc.Next() { + sequenceNode.AddChild(doc.Value.(*CandidateNode)) + } + return sequenceNode, nil } func loadYamlOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { diff --git a/pkg/yqlib/operator_modulo.go b/pkg/yqlib/operator_modulo.go index 05d8f821..08388f15 100644 --- a/pkg/yqlib/operator_modulo.go +++ b/pkg/yqlib/operator_modulo.go @@ -13,7 +13,7 @@ func moduloOperator(d *dataTreeNavigator, context Context, expressionNode *Expre return crossFunction(d, context.ReadOnlyClone(), expressionNode, modulo, false) } -func modulo(d *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) { +func modulo(_ *dataTreeNavigator, _ Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) { if lhs.Tag == "!!null" { return nil, fmt.Errorf("%v (%v) cannot modulo by %v (%v)", lhs.Tag, lhs.GetNicePath(), rhs.Tag, rhs.GetNicePath()) } diff --git a/pkg/yqlib/operator_parent.go b/pkg/yqlib/operator_parent.go index ab0f03d0..eefe424f 100644 --- a/pkg/yqlib/operator_parent.go +++ b/pkg/yqlib/operator_parent.go @@ -2,7 +2,7 @@ package yqlib import "container/list" -func getParentOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func getParentOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { log.Debugf("-- getParentOperator") var results = list.New() diff --git a/pkg/yqlib/operator_path.go b/pkg/yqlib/operator_path.go index 88a97fee..a3a687c3 100644 --- a/pkg/yqlib/operator_path.go +++ b/pkg/yqlib/operator_path.go @@ -147,7 +147,7 @@ func delPathsOperator(d *dataTreeNavigator, context Context, expressionNode *Exp } -func getPathOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func getPathOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { log.Debugf("GetPath") var results = list.New() diff --git a/pkg/yqlib/operator_recursive_descent.go b/pkg/yqlib/operator_recursive_descent.go index 775bd2a6..a00c53eb 100644 --- a/pkg/yqlib/operator_recursive_descent.go +++ b/pkg/yqlib/operator_recursive_descent.go @@ -9,7 +9,7 @@ type recursiveDescentPreferences struct { RecurseArray bool } -func recursiveDescentOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func recursiveDescentOperator(_ *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { var results = list.New() preferences := expressionNode.Operation.Preferences.(recursiveDescentPreferences) diff --git a/pkg/yqlib/operator_reverse.go b/pkg/yqlib/operator_reverse.go index ef2e0a45..8733f442 100644 --- a/pkg/yqlib/operator_reverse.go +++ b/pkg/yqlib/operator_reverse.go @@ -5,7 +5,7 @@ import ( "fmt" ) -func reverseOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func reverseOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { results := list.New() for el := context.MatchingNodes.Front(); el != nil; el = el.Next() { diff --git a/pkg/yqlib/operator_self.go b/pkg/yqlib/operator_self.go index 232f7d7d..2ef8e2bc 100644 --- a/pkg/yqlib/operator_self.go +++ b/pkg/yqlib/operator_self.go @@ -1,5 +1,5 @@ package yqlib -func selfOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func selfOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { return context, nil } diff --git a/pkg/yqlib/operator_shuffle.go b/pkg/yqlib/operator_shuffle.go index 15308728..9ccad23d 100644 --- a/pkg/yqlib/operator_shuffle.go +++ b/pkg/yqlib/operator_shuffle.go @@ -6,7 +6,7 @@ import ( "math/rand" ) -func shuffleOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func shuffleOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { // ignore CWE-338 gosec issue of not using crypto/rand // this is just to shuffle an array rather generating a diff --git a/pkg/yqlib/operator_split_document.go b/pkg/yqlib/operator_split_document.go index e9fb245b..d80d7b57 100644 --- a/pkg/yqlib/operator_split_document.go +++ b/pkg/yqlib/operator_split_document.go @@ -1,6 +1,6 @@ package yqlib -func splitDocumentOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func splitDocumentOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { log.Debugf("-- splitDocumentOperator") var index uint diff --git a/pkg/yqlib/operator_strings.go b/pkg/yqlib/operator_strings.go index 7ac6986b..36106356 100644 --- a/pkg/yqlib/operator_strings.go +++ b/pkg/yqlib/operator_strings.go @@ -11,7 +11,7 @@ type changeCasePrefs struct { ToUpperCase bool } -func trimSpaceOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func trimSpaceOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { results := list.New() for el := context.MatchingNodes.Front(); el != nil; el = el.Next() { node := el.Value.(*CandidateNode) @@ -29,7 +29,7 @@ func trimSpaceOperator(d *dataTreeNavigator, context Context, expressionNode *Ex return context.ChildContext(results), nil } -func changeCaseOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func changeCaseOperator(_ *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { results := list.New() prefs := expressionNode.Operation.Preferences.(changeCasePrefs) diff --git a/pkg/yqlib/operator_style.go b/pkg/yqlib/operator_style.go index 2db8cc16..37aad865 100644 --- a/pkg/yqlib/operator_style.go +++ b/pkg/yqlib/operator_style.go @@ -71,7 +71,7 @@ func assignStyleOperator(d *dataTreeNavigator, context Context, expressionNode * return context, nil } -func getStyleOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func getStyleOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { log.Debugf("GetStyleOperator") var results = list.New() diff --git a/pkg/yqlib/operator_subtract.go b/pkg/yqlib/operator_subtract.go index 260f3cbe..f872e7c3 100644 --- a/pkg/yqlib/operator_subtract.go +++ b/pkg/yqlib/operator_subtract.go @@ -42,7 +42,7 @@ func subtractArray(lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, erro return lhs, nil } -func subtract(d *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) { +func subtract(_ *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) { if lhs.Tag == "!!null" { return lhs.CopyAsReplacement(rhs), nil } diff --git a/pkg/yqlib/operator_tag.go b/pkg/yqlib/operator_tag.go index 87f82dca..81b5eaf1 100644 --- a/pkg/yqlib/operator_tag.go +++ b/pkg/yqlib/operator_tag.go @@ -45,7 +45,7 @@ func assignTagOperator(d *dataTreeNavigator, context Context, expressionNode *Ex return context, nil } -func getTagOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func getTagOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { log.Debugf("GetTagOperator") var results = list.New() diff --git a/pkg/yqlib/operator_to_number.go b/pkg/yqlib/operator_to_number.go index 595ca538..312010e6 100644 --- a/pkg/yqlib/operator_to_number.go +++ b/pkg/yqlib/operator_to_number.go @@ -22,7 +22,7 @@ func tryConvertToNumber(value string) (string, bool) { } -func toNumberOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func toNumberOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { log.Debugf("ToNumberOperator") var results = list.New() diff --git a/pkg/yqlib/operator_traverse_path.go b/pkg/yqlib/operator_traverse_path.go index 0d2e5f52..6bf3adf1 100644 --- a/pkg/yqlib/operator_traverse_path.go +++ b/pkg/yqlib/operator_traverse_path.go @@ -19,7 +19,7 @@ func splat(context Context, prefs traversePreferences) (Context, error) { return traverseNodesWithArrayIndices(context, make([]*CandidateNode, 0), prefs) } -func traversePathOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func traversePathOperator(_ *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { log.Debugf("-- traversePathOperator") var matches = list.New() diff --git a/pkg/yqlib/operator_unique.go b/pkg/yqlib/operator_unique.go index 2ba69ce0..5e4ecdb4 100644 --- a/pkg/yqlib/operator_unique.go +++ b/pkg/yqlib/operator_unique.go @@ -7,7 +7,7 @@ import ( "github.com/elliotchance/orderedmap" ) -func unique(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func unique(d *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { selfExpression := &ExpressionNode{Operation: &Operation{OperationType: selfReferenceOpType}} uniqueByExpression := &ExpressionNode{Operation: &Operation{OperationType: uniqueByOpType}, RHS: selfExpression} return uniqueBy(d, context, uniqueByExpression) diff --git a/pkg/yqlib/operator_value.go b/pkg/yqlib/operator_value.go index 740893af..65438e82 100644 --- a/pkg/yqlib/operator_value.go +++ b/pkg/yqlib/operator_value.go @@ -2,11 +2,11 @@ package yqlib import "container/list" -func referenceOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func referenceOperator(_ *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { return context.SingleChildContext(expressionNode.Operation.CandidateNode), nil } -func valueOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func valueOperator(_ *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { log.Debug("value = %v", expressionNode.Operation.CandidateNode.Value) if context.MatchingNodes.Len() == 0 { clone := expressionNode.Operation.CandidateNode.Copy() diff --git a/pkg/yqlib/operator_variables.go b/pkg/yqlib/operator_variables.go index 01a946ec..d1c9c20f 100644 --- a/pkg/yqlib/operator_variables.go +++ b/pkg/yqlib/operator_variables.go @@ -5,7 +5,7 @@ import ( "fmt" ) -func getVariableOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func getVariableOperator(_ *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { variableName := expressionNode.Operation.StringValue log.Debug("getVariableOperator %v", variableName) result := context.GetVariable(variableName) @@ -19,7 +19,7 @@ type assignVarPreferences struct { IsReference bool } -func useWithPipe(d *dataTreeNavigator, context Context, originalExp *ExpressionNode) (Context, error) { +func useWithPipe(_ *dataTreeNavigator, _ Context, _ *ExpressionNode) (Context, error) { return Context{}, fmt.Errorf("must use variable with a pipe, e.g. `exp as $x | ...`") } diff --git a/pkg/yqlib/operators.go b/pkg/yqlib/operators.go index f4f33e55..994a8767 100644 --- a/pkg/yqlib/operators.go +++ b/pkg/yqlib/operators.go @@ -51,7 +51,7 @@ func compoundAssignFunction(d *dataTreeNavigator, context Context, expressionNod return context, nil } -func emptyOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +func emptyOperator(_ *dataTreeNavigator, context Context, _ *ExpressionNode) (Context, error) { context.MatchingNodes = list.New() return context, nil } diff --git a/pkg/yqlib/operators_test.go b/pkg/yqlib/operators_test.go index 56340cbb..9de2bbc4 100644 --- a/pkg/yqlib/operators_test.go +++ b/pkg/yqlib/operators_test.go @@ -40,7 +40,7 @@ func TestMain(m *testing.M) { os.Exit(code) } -func NewSimpleYamlPrinter(writer io.Writer, outputFormat PrinterOutputFormat, unwrapScalar bool, colorsEnabled bool, indent int, printDocSeparators bool) Printer { +func NewSimpleYamlPrinter(writer io.Writer, _ PrinterOutputFormat, unwrapScalar bool, colorsEnabled bool, indent int, printDocSeparators bool) Printer { prefs := NewDefaultYamlPreferences() prefs.PrintDocSeparators = printDocSeparators prefs.UnwrapScalar = unwrapScalar diff --git a/pkg/yqlib/printer_writer.go b/pkg/yqlib/printer_writer.go index d1b1e336..b900df27 100644 --- a/pkg/yqlib/printer_writer.go +++ b/pkg/yqlib/printer_writer.go @@ -22,7 +22,7 @@ func NewSinglePrinterWriter(writer io.Writer) PrinterWriter { } } -func (sp *singlePrinterWriter) GetWriter(node *CandidateNode) (*bufio.Writer, error) { +func (sp *singlePrinterWriter) GetWriter(_ *CandidateNode) (*bufio.Writer, error) { return sp.bufferedWriter, nil } diff --git a/pkg/yqlib/properties_test.go b/pkg/yqlib/properties_test.go index 8ca996b0..43293428 100644 --- a/pkg/yqlib/properties_test.go +++ b/pkg/yqlib/properties_test.go @@ -350,7 +350,7 @@ func documentRoundTripPropertyScenario(w *bufio.Writer, s formatScenario) { writeOrPanic(w, fmt.Sprintf("```properties\n%v```\n\n", mustProcessFormatScenario(s, NewPropertiesDecoder(), NewPropertiesEncoder(true)))) } -func documentPropertyScenario(t *testing.T, w *bufio.Writer, i interface{}) { +func documentPropertyScenario(_ *testing.T, w *bufio.Writer, i interface{}) { s := i.(formatScenario) if s.skipDoc { return diff --git a/pkg/yqlib/toml_test.go b/pkg/yqlib/toml_test.go index 2e0765dc..bf17d6f9 100644 --- a/pkg/yqlib/toml_test.go +++ b/pkg/yqlib/toml_test.go @@ -268,7 +268,7 @@ func documentTomlRoundtripScenario(w *bufio.Writer, s formatScenario) { writeOrPanic(w, fmt.Sprintf("```yaml\n%v```\n\n", mustProcessFormatScenario(s, NewTomlDecoder(), NewTomlEncoder()))) } -func documentTomlScenario(t *testing.T, w *bufio.Writer, i interface{}) { +func documentTomlScenario(_ *testing.T, w *bufio.Writer, i interface{}) { s := i.(formatScenario) if s.skipDoc { diff --git a/pkg/yqlib/xml_test.go b/pkg/yqlib/xml_test.go index b1620a0d..20a75514 100644 --- a/pkg/yqlib/xml_test.go +++ b/pkg/yqlib/xml_test.go @@ -658,7 +658,7 @@ func testXMLScenario(t *testing.T, s formatScenario) { } } -func documentXMLScenario(t *testing.T, w *bufio.Writer, i interface{}) { +func documentXMLScenario(_ *testing.T, w *bufio.Writer, i interface{}) { s := i.(formatScenario) if s.skipDoc { diff --git a/project-words.txt b/project-words.txt index a68e7542..a361252c 100644 --- a/project-words.txt +++ b/project-words.txt @@ -250,4 +250,5 @@ yqlib yuin zabbix tonumber -noyaml \ No newline at end of file +noyaml +nolint \ No newline at end of file diff --git a/scripts/devtools.sh b/scripts/devtools.sh index 01d76711..49e7a43a 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.51.1 +curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2 wget -O- -nv https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s