Skip to content

Commit

Permalink
🧹 migrate os/npm
Browse files Browse the repository at this point in the history
we do not use it yet, but it will come up soon, so migrate

Signed-off-by: Dominik Richter <[email protected]>
  • Loading branch information
arlimus committed Sep 11, 2023
1 parent 3384a16 commit 4d53feb
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ package npm
import (
"encoding/json"
"io"
"io/ioutil"

"go.mondoo.com/cnquery/upstream/mvd"
"go.mondoo.com/cnquery/providers-sdk/v1/upstream/mvd"
)

// PackageJson allows parsing the package json file
Expand All @@ -34,7 +33,7 @@ type PackageJsonLock struct {
}

func ParsePackageJson(r io.Reader) ([]*mvd.Package, error) {
data, err := ioutil.ReadAll(r)
data, err := io.ReadAll(r)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -70,7 +69,7 @@ func ParsePackageJson(r io.Reader) ([]*mvd.Package, error) {
}

func ParsePackageJsonLock(r io.Reader) ([]*mvd.Package, error) {
data, err := ioutil.ReadAll(r)
data, err := io.ReadAll(r)
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"go.mondoo.com/cnquery/resources/packs/os/npm"
"go.mondoo.com/cnquery/upstream/mvd"
"go.mondoo.com/cnquery/providers-sdk/v1/upstream/mvd"
"go.mondoo.com/cnquery/providers/os/resources/npm"
)

func TestPackageJsonParser(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"strings"

"github.com/rs/zerolog/log"
"go.mondoo.com/cnquery/upstream/mvd"
"go.mondoo.com/cnquery/providers-sdk/v1/upstream/mvd"
"sigs.k8s.io/yaml"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"go.mondoo.com/cnquery/resources/packs/os/npm"
"go.mondoo.com/cnquery/upstream/mvd"
"go.mondoo.com/cnquery/providers-sdk/v1/upstream/mvd"
"go.mondoo.com/cnquery/providers/os/resources/npm"
)

func TestYarnParser(t *testing.T) {
Expand Down

0 comments on commit 4d53feb

Please sign in to comment.