Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update module gopkg.in/yaml.v2 to v3 #147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ require (
github.com/newrelic/nrjmx/gojmx v0.0.0-20240305121005-9fddfa34e08e
github.com/stretchr/testify v1.9.0
github.com/xeipuuv/gojsonschema v1.2.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
)

Expand Down
2 changes: 1 addition & 1 deletion src/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

import (
"errors"
"io/ioutil"

Check failure on line 10 in src/inventory.go

View workflow job for this annotation

GitHub Actions / push-pr / static-analysis / Run all static analysis checks

SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"regexp"

"github.com/newrelic/infra-integrations-sdk/v3/log"

"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"

"github.com/newrelic/infra-integrations-sdk/v3/data/inventory"
)
Expand Down Expand Up @@ -40,7 +40,7 @@
return i, nil
}

func populateInventory(i *inventory.Inventory, rawInventory inventory.Item) error {

Check failure on line 43 in src/inventory.go

View workflow job for this annotation

GitHub Actions / push-pr / static-analysis / Run all static analysis checks

populateInventory - result 0 (error) is always nil (unparam)
for k, v := range rawInventory {
switch value := v.(type) {
case map[interface{}]interface{}:
Expand All @@ -62,7 +62,7 @@
}

func setValue(i *inventory.Inventory, key string, field string, value interface{}) {
re, _ := regexp.Compile("(?i)password")

Check failure on line 65 in src/inventory.go

View workflow job for this annotation

GitHub Actions / push-pr / static-analysis / Run all static analysis checks

regexpMust: for const patterns like "(?i)password", use regexp.MustCompile (gocritic)

if re.MatchString(key) || re.MatchString(field) {
value = "(omitted value)"
Expand Down
Loading