From 3f45e9130138e8e0683308f683d891e9b3007458 Mon Sep 17 00:00:00 2001 From: viktigpetterr Date: Wed, 12 Apr 2023 08:41:17 +0200 Subject: [PATCH] Move packages to internal/ --- .github/workflows/test.yml | 2 +- cmd/debricked/main.go | 2 +- {pkg => internal}/automation/rule.go | 0 {pkg => internal}/automation/rule_test.go | 0 {pkg => internal}/automation/trigger.go | 0 {pkg => internal}/ci/argo/ci.go | 6 ++-- {pkg => internal}/ci/argo/ci_test.go | 4 +-- {pkg => internal}/ci/azure/ci.go | 4 +-- {pkg => internal}/ci/azure/ci_test.go | 2 +- {pkg => internal}/ci/bitbucket/ci.go | 6 ++-- {pkg => internal}/ci/bitbucket/ci_test.go | 4 +-- {pkg => internal}/ci/buildkite/ci.go | 6 ++-- {pkg => internal}/ci/buildkite/ci_test.go | 4 +-- {pkg => internal}/ci/ci.go | 2 +- {pkg => internal}/ci/circleci/ci.go | 6 ++-- {pkg => internal}/ci/circleci/ci_test.go | 4 +-- {pkg => internal}/ci/env/env.go | 0 {pkg => internal}/ci/github/ci.go | 4 +-- {pkg => internal}/ci/github/ci_test.go | 4 +-- {pkg => internal}/ci/gitlab/ci.go | 4 +-- {pkg => internal}/ci/gitlab/ci_test.go | 2 +- {pkg => internal}/ci/service.go | 18 +++++------ {pkg => internal}/ci/service_test.go | 8 ++--- {pkg => internal}/ci/testdata/ci_assert.go | 0 {pkg => internal}/ci/testdata/env.go | 0 {pkg => internal}/ci/travis/ci.go | 6 ++-- {pkg => internal}/ci/travis/ci_test.go | 4 +-- {pkg => internal}/ci/util/util.go | 0 {pkg => internal}/ci/util/util_test.go | 2 +- {pkg => internal}/client/client.go | 0 {pkg => internal}/client/deb_client.go | 0 {pkg => internal}/client/deb_client_test.go | 2 +- {pkg => internal}/client/request.go | 0 {pkg => internal}/client/request_test.go | 2 +- {pkg => internal}/client/retry.go | 0 {pkg => internal}/client/retry_test.go | 0 .../client/testdata/client/client_mock.go | 0 .../client/testdata/deb_client_mock.go | 7 ++-- {pkg => internal}/cmd/files/files.go | 6 ++-- {pkg => internal}/cmd/files/files_test.go | 4 +-- {pkg => internal}/cmd/files/find/find.go | 2 +- {pkg => internal}/cmd/files/find/find_test.go | 4 +-- .../cmd/report/license/license.go | 4 +-- .../cmd/report/license/license_test.go | 4 +-- {pkg => internal}/cmd/report/report.go | 10 +++--- {pkg => internal}/cmd/report/report_test.go | 4 +-- .../cmd/report/testdata/reporter_mock.go | 2 +- .../cmd/report/vulnerability/vulnerability.go | 4 +-- .../vulnerability/vulnerability_test.go | 4 +-- {pkg => internal}/cmd/root/root.go | 8 ++--- {pkg => internal}/cmd/root/root_test.go | 0 {pkg => internal}/cmd/scan/scan.go | 8 ++--- {pkg => internal}/cmd/scan/scan_test.go | 6 ++-- {pkg => internal}/file/default_exclusion.go | 0 .../file/default_exclusion_test.go | 0 {pkg => internal}/file/finder.go | 2 +- {pkg => internal}/file/finder_test.go | 2 +- {pkg => internal}/file/format.go | 2 +- {pkg => internal}/file/format_test.go | 0 {pkg => internal}/file/group.go | 0 {pkg => internal}/file/group_test.go | 0 {pkg => internal}/file/groups.go | 0 {pkg => internal}/file/groups_test.go | 0 {pkg => internal}/file/pcre/pcre.go | 0 {pkg => internal}/file/pcre/pcre_test.go | 0 .../file/testdata/composer/composer.json | 0 .../file/testdata/composer/composer.lock | 0 .../file/testdata/finder_mock.go | 2 +- {pkg => internal}/file/testdata/go/go.mod | 0 .../file/testdata/misc/Cargo.lock | 0 .../file/testdata/misc/requirements.txt | 0 .../file/testdata/pip/requirements-dev.txt | 0 .../requirements-dev.txt.pip.debricked.lock | 0 .../file/testdata/pip/requirements.txt | 0 .../pip/requirements.txt.pip.debricked.lock | 0 .../file/testdata/yarn/yarn.lock | 0 {pkg => internal}/git/git.go | 0 {pkg => internal}/git/git_test.go | 0 {pkg => internal}/git/meta_object.go | 0 {pkg => internal}/git/meta_object_test.go | 2 +- {pkg => internal}/report/license/report.go | 4 +-- .../report/license/report_test.go | 2 +- {pkg => internal}/report/report.go | 0 .../report/vulnerability/report.go | 4 +-- .../report/vulnerability/report_test.go | 2 +- {pkg => internal}/scan/scanner.go | 14 ++++---- {pkg => internal}/scan/scanner_test.go | 32 +++++++++---------- .../scan/testdata/yarn/package.json | 0 .../scan/testdata/yarn/yarn.lock | 0 {pkg => internal}/tui/dependency.go | 2 +- {pkg => internal}/tui/dependency_test.go | 2 +- {pkg => internal}/tui/progress_bar.go | 0 {pkg => internal}/tui/progress_bar_test.go | 0 {pkg => internal}/tui/rule_card.go | 2 +- {pkg => internal}/tui/rule_card_test.go | 2 +- {pkg => internal}/tui/vulnerability.go | 0 {pkg => internal}/upload/batch.go | 8 ++--- {pkg => internal}/upload/batch_test.go | 8 ++--- {pkg => internal}/upload/result.go | 2 +- {pkg => internal}/upload/result_test.go | 0 {pkg => internal}/upload/status.go | 2 +- {pkg => internal}/upload/status_test.go | 0 .../upload/testdata/misc/requirements.txt | 0 .../upload/testdata/yarn/package.json | 0 .../upload/testdata/yarn/yarn.lock | 0 {pkg => internal}/upload/uploader.go | 6 ++-- {pkg => internal}/upload/uploader_test.go | 8 ++--- 107 files changed, 149 insertions(+), 146 deletions(-) rename {pkg => internal}/automation/rule.go (100%) rename {pkg => internal}/automation/rule_test.go (100%) rename {pkg => internal}/automation/trigger.go (100%) rename {pkg => internal}/ci/argo/ci.go (95%) rename {pkg => internal}/ci/argo/ci_test.go (96%) rename {pkg => internal}/ci/azure/ci.go (88%) rename {pkg => internal}/ci/azure/ci_test.go (95%) rename {pkg => internal}/ci/bitbucket/ci.go (84%) rename {pkg => internal}/ci/bitbucket/ci_test.go (92%) rename {pkg => internal}/ci/buildkite/ci.go (94%) rename {pkg => internal}/ci/buildkite/ci_test.go (96%) rename {pkg => internal}/ci/ci.go (60%) rename {pkg => internal}/ci/circleci/ci.go (92%) rename {pkg => internal}/ci/circleci/ci_test.go (95%) rename {pkg => internal}/ci/env/env.go (100%) rename {pkg => internal}/ci/github/ci.go (91%) rename {pkg => internal}/ci/github/ci_test.go (95%) rename {pkg => internal}/ci/gitlab/ci.go (85%) rename {pkg => internal}/ci/gitlab/ci_test.go (95%) rename {pkg => internal}/ci/service.go (61%) rename {pkg => internal}/ci/service_test.go (80%) rename {pkg => internal}/ci/testdata/ci_assert.go (100%) rename {pkg => internal}/ci/testdata/env.go (100%) rename {pkg => internal}/ci/travis/ci.go (86%) rename {pkg => internal}/ci/travis/ci_test.go (92%) rename {pkg => internal}/ci/util/util.go (100%) rename {pkg => internal}/ci/util/util_test.go (91%) rename {pkg => internal}/client/client.go (100%) rename {pkg => internal}/client/deb_client.go (100%) rename {pkg => internal}/client/deb_client_test.go (98%) rename {pkg => internal}/client/request.go (100%) rename {pkg => internal}/client/request_test.go (91%) rename {pkg => internal}/client/retry.go (100%) rename {pkg => internal}/client/retry_test.go (100%) rename {pkg => internal}/client/testdata/client/client_mock.go (100%) rename {pkg => internal}/client/testdata/deb_client_mock.go (97%) rename {pkg => internal}/cmd/files/files.go (75%) rename {pkg => internal}/cmd/files/files_test.go (84%) rename {pkg => internal}/cmd/files/find/find.go (98%) rename {pkg => internal}/cmd/files/find/find_test.go (97%) rename {pkg => internal}/cmd/report/license/license.go (93%) rename {pkg => internal}/cmd/report/license/license_test.go (92%) rename {pkg => internal}/cmd/report/report.go (68%) rename {pkg => internal}/cmd/report/report_test.go (83%) rename {pkg => internal}/cmd/report/testdata/reporter_mock.go (83%) rename {pkg => internal}/cmd/report/vulnerability/vulnerability.go (92%) rename {pkg => internal}/cmd/report/vulnerability/vulnerability_test.go (93%) rename {pkg => internal}/cmd/root/root.go (87%) rename {pkg => internal}/cmd/root/root_test.go (100%) rename {pkg => internal}/cmd/scan/scan.go (95%) rename {pkg => internal}/cmd/scan/scan_test.go (93%) rename {pkg => internal}/file/default_exclusion.go (100%) rename {pkg => internal}/file/default_exclusion_test.go (100%) rename {pkg => internal}/file/finder.go (98%) rename {pkg => internal}/file/finder_test.go (99%) rename {pkg => internal}/file/format.go (97%) rename {pkg => internal}/file/format_test.go (100%) rename {pkg => internal}/file/group.go (100%) rename {pkg => internal}/file/group_test.go (100%) rename {pkg => internal}/file/groups.go (100%) rename {pkg => internal}/file/groups_test.go (100%) rename {pkg => internal}/file/pcre/pcre.go (100%) rename {pkg => internal}/file/pcre/pcre_test.go (100%) rename {pkg => internal}/file/testdata/composer/composer.json (100%) rename {pkg => internal}/file/testdata/composer/composer.lock (100%) rename {pkg => internal}/file/testdata/finder_mock.go (95%) rename {pkg => internal}/file/testdata/go/go.mod (100%) rename {pkg => internal}/file/testdata/misc/Cargo.lock (100%) rename {pkg => internal}/file/testdata/misc/requirements.txt (100%) rename {pkg => internal}/file/testdata/pip/requirements-dev.txt (100%) rename {pkg => internal}/file/testdata/pip/requirements-dev.txt.pip.debricked.lock (100%) rename {pkg => internal}/file/testdata/pip/requirements.txt (100%) rename {pkg => internal}/file/testdata/pip/requirements.txt.pip.debricked.lock (100%) rename {pkg => internal}/file/testdata/yarn/yarn.lock (100%) rename {pkg => internal}/git/git.go (100%) rename {pkg => internal}/git/git_test.go (100%) rename {pkg => internal}/git/meta_object.go (100%) rename {pkg => internal}/git/meta_object_test.go (96%) rename {pkg => internal}/report/license/report.go (95%) rename {pkg => internal}/report/license/report_test.go (98%) rename {pkg => internal}/report/report.go (100%) rename {pkg => internal}/report/vulnerability/report.go (91%) rename {pkg => internal}/report/vulnerability/report_test.go (96%) rename {pkg => internal}/scan/scanner.go (92%) rename {pkg => internal}/scan/scanner_test.go (94%) rename {pkg => internal}/scan/testdata/yarn/package.json (100%) rename {pkg => internal}/scan/testdata/yarn/yarn.lock (100%) rename {pkg => internal}/tui/dependency.go (95%) rename {pkg => internal}/tui/dependency_test.go (98%) rename {pkg => internal}/tui/progress_bar.go (100%) rename {pkg => internal}/tui/progress_bar_test.go (100%) rename {pkg => internal}/tui/rule_card.go (98%) rename {pkg => internal}/tui/rule_card_test.go (98%) rename {pkg => internal}/tui/vulnerability.go (100%) rename {pkg => internal}/upload/batch.go (97%) rename {pkg => internal}/upload/batch_test.go (95%) rename {pkg => internal}/upload/result.go (93%) rename {pkg => internal}/upload/result_test.go (100%) rename {pkg => internal}/upload/status.go (94%) rename {pkg => internal}/upload/status_test.go (100%) rename {pkg => internal}/upload/testdata/misc/requirements.txt (100%) rename {pkg => internal}/upload/testdata/yarn/package.json (100%) rename {pkg => internal}/upload/testdata/yarn/yarn.lock (100%) rename {pkg => internal}/upload/uploader.go (89%) rename {pkg => internal}/upload/uploader_test.go (95%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8412290b..2b285984 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,7 +47,7 @@ jobs: retention-days: 2 - name: E2E - scan - run: go run cmd/debricked/main.go scan pkg/file/testdata/misc -e requirements.txt -t ${{ secrets.DEBRICKED_TOKEN }} -r debricked/cli-test -c E2E-test-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }} + run: go run cmd/debricked/main.go scan internal/file/testdata/misc -e requirements.txt -t ${{ secrets.DEBRICKED_TOKEN }} -r debricked/cli-test -c E2E-test-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }} golangci: name: Lint diff --git a/cmd/debricked/main.go b/cmd/debricked/main.go index 91b0f34a..5232336f 100644 --- a/cmd/debricked/main.go +++ b/cmd/debricked/main.go @@ -3,7 +3,7 @@ package main import ( "os" - "github.com/debricked/cli/pkg/cmd/root" + "github.com/debricked/cli/internal/cmd/root" ) var version string // Set at compile time diff --git a/pkg/automation/rule.go b/internal/automation/rule.go similarity index 100% rename from pkg/automation/rule.go rename to internal/automation/rule.go diff --git a/pkg/automation/rule_test.go b/internal/automation/rule_test.go similarity index 100% rename from pkg/automation/rule_test.go rename to internal/automation/rule_test.go diff --git a/pkg/automation/trigger.go b/internal/automation/trigger.go similarity index 100% rename from pkg/automation/trigger.go rename to internal/automation/trigger.go diff --git a/pkg/ci/argo/ci.go b/internal/ci/argo/ci.go similarity index 95% rename from pkg/ci/argo/ci.go rename to internal/ci/argo/ci.go index ade16234..5f2a03e1 100644 --- a/pkg/ci/argo/ci.go +++ b/internal/ci/argo/ci.go @@ -5,9 +5,9 @@ import ( "os" "regexp" - "github.com/debricked/cli/pkg/ci/env" - "github.com/debricked/cli/pkg/ci/util" - "github.com/debricked/cli/pkg/git" + "github.com/debricked/cli/internal/ci/env" + "github.com/debricked/cli/internal/ci/util" + "github.com/debricked/cli/internal/git" ) const ( diff --git a/pkg/ci/argo/ci_test.go b/internal/ci/argo/ci_test.go similarity index 96% rename from pkg/ci/argo/ci_test.go rename to internal/ci/argo/ci_test.go index be6d708a..471df97b 100644 --- a/pkg/ci/argo/ci_test.go +++ b/internal/ci/argo/ci_test.go @@ -3,8 +3,8 @@ package argo import ( "testing" - "github.com/debricked/cli/pkg/ci/env" - "github.com/debricked/cli/pkg/ci/testdata" + "github.com/debricked/cli/internal/ci/env" + "github.com/debricked/cli/internal/ci/testdata" "github.com/stretchr/testify/assert" ) diff --git a/pkg/ci/azure/ci.go b/internal/ci/azure/ci.go similarity index 88% rename from pkg/ci/azure/ci.go rename to internal/ci/azure/ci.go index d3d8eb26..f46e328a 100644 --- a/pkg/ci/azure/ci.go +++ b/internal/ci/azure/ci.go @@ -5,8 +5,8 @@ import ( "os" "path/filepath" - "github.com/debricked/cli/pkg/ci/env" - "github.com/debricked/cli/pkg/ci/util" + "github.com/debricked/cli/internal/ci/env" + "github.com/debricked/cli/internal/ci/util" ) const ( diff --git a/pkg/ci/azure/ci_test.go b/internal/ci/azure/ci_test.go similarity index 95% rename from pkg/ci/azure/ci_test.go rename to internal/ci/azure/ci_test.go index 916639ed..59afe378 100644 --- a/pkg/ci/azure/ci_test.go +++ b/internal/ci/azure/ci_test.go @@ -3,7 +3,7 @@ package azure import ( "testing" - "github.com/debricked/cli/pkg/ci/testdata" + "github.com/debricked/cli/internal/ci/testdata" "github.com/stretchr/testify/assert" ) diff --git a/pkg/ci/bitbucket/ci.go b/internal/ci/bitbucket/ci.go similarity index 84% rename from pkg/ci/bitbucket/ci.go rename to internal/ci/bitbucket/ci.go index a92db3a9..ef912160 100644 --- a/pkg/ci/bitbucket/ci.go +++ b/internal/ci/bitbucket/ci.go @@ -4,9 +4,9 @@ import ( "fmt" "os" - "github.com/debricked/cli/pkg/ci/env" - "github.com/debricked/cli/pkg/ci/util" - "github.com/debricked/cli/pkg/git" + "github.com/debricked/cli/internal/ci/env" + "github.com/debricked/cli/internal/ci/util" + "github.com/debricked/cli/internal/git" ) const ( diff --git a/pkg/ci/bitbucket/ci_test.go b/internal/ci/bitbucket/ci_test.go similarity index 92% rename from pkg/ci/bitbucket/ci_test.go rename to internal/ci/bitbucket/ci_test.go index 7464febe..e243992d 100644 --- a/pkg/ci/bitbucket/ci_test.go +++ b/internal/ci/bitbucket/ci_test.go @@ -3,8 +3,8 @@ package bitbucket import ( "testing" - "github.com/debricked/cli/pkg/ci/env" - "github.com/debricked/cli/pkg/ci/testdata" + "github.com/debricked/cli/internal/ci/env" + "github.com/debricked/cli/internal/ci/testdata" "github.com/stretchr/testify/assert" ) diff --git a/pkg/ci/buildkite/ci.go b/internal/ci/buildkite/ci.go similarity index 94% rename from pkg/ci/buildkite/ci.go rename to internal/ci/buildkite/ci.go index c763f2d5..771637cb 100644 --- a/pkg/ci/buildkite/ci.go +++ b/internal/ci/buildkite/ci.go @@ -5,9 +5,9 @@ import ( "os" "regexp" - "github.com/debricked/cli/pkg/ci/env" - "github.com/debricked/cli/pkg/ci/util" - "github.com/debricked/cli/pkg/git" + "github.com/debricked/cli/internal/ci/env" + "github.com/debricked/cli/internal/ci/util" + "github.com/debricked/cli/internal/git" ) const ( diff --git a/pkg/ci/buildkite/ci_test.go b/internal/ci/buildkite/ci_test.go similarity index 96% rename from pkg/ci/buildkite/ci_test.go rename to internal/ci/buildkite/ci_test.go index ee1544c2..b6db90e1 100644 --- a/pkg/ci/buildkite/ci_test.go +++ b/internal/ci/buildkite/ci_test.go @@ -3,8 +3,8 @@ package buildkite import ( "testing" - "github.com/debricked/cli/pkg/ci/env" - "github.com/debricked/cli/pkg/ci/testdata" + "github.com/debricked/cli/internal/ci/env" + "github.com/debricked/cli/internal/ci/testdata" "github.com/stretchr/testify/assert" ) diff --git a/pkg/ci/ci.go b/internal/ci/ci.go similarity index 60% rename from pkg/ci/ci.go rename to internal/ci/ci.go index 39252890..7b912851 100644 --- a/pkg/ci/ci.go +++ b/internal/ci/ci.go @@ -1,6 +1,6 @@ package ci -import "github.com/debricked/cli/pkg/ci/env" +import "github.com/debricked/cli/internal/ci/env" type ICi interface { Identify() bool diff --git a/pkg/ci/circleci/ci.go b/internal/ci/circleci/ci.go similarity index 92% rename from pkg/ci/circleci/ci.go rename to internal/ci/circleci/ci.go index f534a2de..ba8af3ac 100644 --- a/pkg/ci/circleci/ci.go +++ b/internal/ci/circleci/ci.go @@ -5,9 +5,9 @@ import ( "os" "regexp" - "github.com/debricked/cli/pkg/ci/env" - "github.com/debricked/cli/pkg/ci/util" - "github.com/debricked/cli/pkg/git" + "github.com/debricked/cli/internal/ci/env" + "github.com/debricked/cli/internal/ci/util" + "github.com/debricked/cli/internal/git" ) const ( diff --git a/pkg/ci/circleci/ci_test.go b/internal/ci/circleci/ci_test.go similarity index 95% rename from pkg/ci/circleci/ci_test.go rename to internal/ci/circleci/ci_test.go index 28a1e885..dbe3e68d 100644 --- a/pkg/ci/circleci/ci_test.go +++ b/internal/ci/circleci/ci_test.go @@ -3,8 +3,8 @@ package circleci import ( "testing" - "github.com/debricked/cli/pkg/ci/env" - "github.com/debricked/cli/pkg/ci/testdata" + "github.com/debricked/cli/internal/ci/env" + "github.com/debricked/cli/internal/ci/testdata" "github.com/stretchr/testify/assert" ) diff --git a/pkg/ci/env/env.go b/internal/ci/env/env.go similarity index 100% rename from pkg/ci/env/env.go rename to internal/ci/env/env.go diff --git a/pkg/ci/github/ci.go b/internal/ci/github/ci.go similarity index 91% rename from pkg/ci/github/ci.go rename to internal/ci/github/ci.go index a0ecc02c..77e18e96 100644 --- a/pkg/ci/github/ci.go +++ b/internal/ci/github/ci.go @@ -5,8 +5,8 @@ import ( "os" "strings" - "github.com/debricked/cli/pkg/ci/env" - "github.com/debricked/cli/pkg/ci/util" + "github.com/debricked/cli/internal/ci/env" + "github.com/debricked/cli/internal/ci/util" ) const ( diff --git a/pkg/ci/github/ci_test.go b/internal/ci/github/ci_test.go similarity index 95% rename from pkg/ci/github/ci_test.go rename to internal/ci/github/ci_test.go index b669cf2d..b7e4f4a9 100644 --- a/pkg/ci/github/ci_test.go +++ b/internal/ci/github/ci_test.go @@ -4,8 +4,8 @@ import ( "os" "testing" - "github.com/debricked/cli/pkg/ci/testdata" - "github.com/debricked/cli/pkg/ci/util" + "github.com/debricked/cli/internal/ci/testdata" + "github.com/debricked/cli/internal/ci/util" "github.com/stretchr/testify/assert" ) diff --git a/pkg/ci/gitlab/ci.go b/internal/ci/gitlab/ci.go similarity index 85% rename from pkg/ci/gitlab/ci.go rename to internal/ci/gitlab/ci.go index e32762fe..5bc97114 100644 --- a/pkg/ci/gitlab/ci.go +++ b/internal/ci/gitlab/ci.go @@ -3,8 +3,8 @@ package gitlab import ( "os" - "github.com/debricked/cli/pkg/ci/env" - "github.com/debricked/cli/pkg/ci/util" + "github.com/debricked/cli/internal/ci/env" + "github.com/debricked/cli/internal/ci/util" ) const ( diff --git a/pkg/ci/gitlab/ci_test.go b/internal/ci/gitlab/ci_test.go similarity index 95% rename from pkg/ci/gitlab/ci_test.go rename to internal/ci/gitlab/ci_test.go index c43be760..68889d40 100644 --- a/pkg/ci/gitlab/ci_test.go +++ b/internal/ci/gitlab/ci_test.go @@ -3,7 +3,7 @@ package gitlab import ( "testing" - "github.com/debricked/cli/pkg/ci/testdata" + "github.com/debricked/cli/internal/ci/testdata" "github.com/stretchr/testify/assert" ) diff --git a/pkg/ci/service.go b/internal/ci/service.go similarity index 61% rename from pkg/ci/service.go rename to internal/ci/service.go index bc9d0627..1cfc0a91 100644 --- a/pkg/ci/service.go +++ b/internal/ci/service.go @@ -4,15 +4,15 @@ import ( "errors" "fmt" - "github.com/debricked/cli/pkg/ci/argo" - "github.com/debricked/cli/pkg/ci/azure" - "github.com/debricked/cli/pkg/ci/bitbucket" - "github.com/debricked/cli/pkg/ci/buildkite" - "github.com/debricked/cli/pkg/ci/circleci" - "github.com/debricked/cli/pkg/ci/env" - "github.com/debricked/cli/pkg/ci/github" - "github.com/debricked/cli/pkg/ci/gitlab" - "github.com/debricked/cli/pkg/ci/travis" + "github.com/debricked/cli/internal/ci/argo" + "github.com/debricked/cli/internal/ci/azure" + "github.com/debricked/cli/internal/ci/bitbucket" + "github.com/debricked/cli/internal/ci/buildkite" + "github.com/debricked/cli/internal/ci/circleci" + "github.com/debricked/cli/internal/ci/env" + "github.com/debricked/cli/internal/ci/github" + "github.com/debricked/cli/internal/ci/gitlab" + "github.com/debricked/cli/internal/ci/travis" ) type IService interface { diff --git a/pkg/ci/service_test.go b/internal/ci/service_test.go similarity index 80% rename from pkg/ci/service_test.go rename to internal/ci/service_test.go index f80fe481..54b4790e 100644 --- a/pkg/ci/service_test.go +++ b/internal/ci/service_test.go @@ -4,10 +4,10 @@ import ( "os" "testing" - "github.com/debricked/cli/pkg/ci/azure" - "github.com/debricked/cli/pkg/ci/circleci" - "github.com/debricked/cli/pkg/ci/gitlab" - "github.com/debricked/cli/pkg/ci/testdata" + "github.com/debricked/cli/internal/ci/azure" + "github.com/debricked/cli/internal/ci/circleci" + "github.com/debricked/cli/internal/ci/gitlab" + "github.com/debricked/cli/internal/ci/testdata" "github.com/stretchr/testify/assert" ) diff --git a/pkg/ci/testdata/ci_assert.go b/internal/ci/testdata/ci_assert.go similarity index 100% rename from pkg/ci/testdata/ci_assert.go rename to internal/ci/testdata/ci_assert.go diff --git a/pkg/ci/testdata/env.go b/internal/ci/testdata/env.go similarity index 100% rename from pkg/ci/testdata/env.go rename to internal/ci/testdata/env.go diff --git a/pkg/ci/travis/ci.go b/internal/ci/travis/ci.go similarity index 86% rename from pkg/ci/travis/ci.go rename to internal/ci/travis/ci.go index 91f8764f..fff0931b 100644 --- a/pkg/ci/travis/ci.go +++ b/internal/ci/travis/ci.go @@ -4,9 +4,9 @@ import ( "fmt" "os" - "github.com/debricked/cli/pkg/ci/env" - "github.com/debricked/cli/pkg/ci/util" - "github.com/debricked/cli/pkg/git" + "github.com/debricked/cli/internal/ci/env" + "github.com/debricked/cli/internal/ci/util" + "github.com/debricked/cli/internal/git" ) const ( diff --git a/pkg/ci/travis/ci_test.go b/internal/ci/travis/ci_test.go similarity index 92% rename from pkg/ci/travis/ci_test.go rename to internal/ci/travis/ci_test.go index 1ab12949..9a2c03e9 100644 --- a/pkg/ci/travis/ci_test.go +++ b/internal/ci/travis/ci_test.go @@ -3,8 +3,8 @@ package travis import ( "testing" - "github.com/debricked/cli/pkg/ci/env" - "github.com/debricked/cli/pkg/ci/testdata" + "github.com/debricked/cli/internal/ci/env" + "github.com/debricked/cli/internal/ci/testdata" "github.com/stretchr/testify/assert" ) diff --git a/pkg/ci/util/util.go b/internal/ci/util/util.go similarity index 100% rename from pkg/ci/util/util.go rename to internal/ci/util/util.go diff --git a/pkg/ci/util/util_test.go b/internal/ci/util/util_test.go similarity index 91% rename from pkg/ci/util/util_test.go rename to internal/ci/util/util_test.go index b5d518cd..942f9a15 100644 --- a/pkg/ci/util/util_test.go +++ b/internal/ci/util/util_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "github.com/debricked/cli/pkg/ci/testdata" + "github.com/debricked/cli/internal/ci/testdata" "github.com/stretchr/testify/assert" ) diff --git a/pkg/client/client.go b/internal/client/client.go similarity index 100% rename from pkg/client/client.go rename to internal/client/client.go diff --git a/pkg/client/deb_client.go b/internal/client/deb_client.go similarity index 100% rename from pkg/client/deb_client.go rename to internal/client/deb_client.go diff --git a/pkg/client/deb_client_test.go b/internal/client/deb_client_test.go similarity index 98% rename from pkg/client/deb_client_test.go rename to internal/client/deb_client_test.go index b39992a6..3ceef00b 100644 --- a/pkg/client/deb_client_test.go +++ b/internal/client/deb_client_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - testdataClient "github.com/debricked/cli/pkg/client/testdata/client" + testdataClient "github.com/debricked/cli/internal/client/testdata/client" ) var client *DebClient diff --git a/pkg/client/request.go b/internal/client/request.go similarity index 100% rename from pkg/client/request.go rename to internal/client/request.go diff --git a/pkg/client/request_test.go b/internal/client/request_test.go similarity index 91% rename from pkg/client/request_test.go rename to internal/client/request_test.go index b7c1ccdb..5aedf723 100644 --- a/pkg/client/request_test.go +++ b/internal/client/request_test.go @@ -5,7 +5,7 @@ import ( "net/http" "testing" - testdataClient "github.com/debricked/cli/pkg/client/testdata/client" + testdataClient "github.com/debricked/cli/internal/client/testdata/client" "github.com/stretchr/testify/assert" ) diff --git a/pkg/client/retry.go b/internal/client/retry.go similarity index 100% rename from pkg/client/retry.go rename to internal/client/retry.go diff --git a/pkg/client/retry_test.go b/internal/client/retry_test.go similarity index 100% rename from pkg/client/retry_test.go rename to internal/client/retry_test.go diff --git a/pkg/client/testdata/client/client_mock.go b/internal/client/testdata/client/client_mock.go similarity index 100% rename from pkg/client/testdata/client/client_mock.go rename to internal/client/testdata/client/client_mock.go diff --git a/pkg/client/testdata/deb_client_mock.go b/internal/client/testdata/deb_client_mock.go similarity index 97% rename from pkg/client/testdata/deb_client_mock.go rename to internal/client/testdata/deb_client_mock.go index 0562f432..8f651fe4 100644 --- a/pkg/client/testdata/deb_client_mock.go +++ b/internal/client/testdata/deb_client_mock.go @@ -2,11 +2,12 @@ package testdata import ( "bytes" + "errors" "io" "net/http" "net/url" - "github.com/debricked/cli/pkg/client" + "github.com/debricked/cli/internal/client" ) type DebClientMock struct { @@ -17,6 +18,7 @@ type DebClientMock struct { func NewDebClientMock() *DebClientMock { debClient := client.NewDebClient(nil, nil) + return &DebClientMock{ realDebClient: debClient, responseQueue: []MockResponse{}, @@ -75,6 +77,7 @@ func (mock *DebClientMock) RemoveQueryParamsFromUri(uri string) string { q.Del(s) } u.RawQuery = q.Encode() + return u.String() } @@ -110,7 +113,7 @@ func (mock *DebClientMock) popResponse(uri string) (*http.Response, error) { TLS: nil, } } else { - return nil, nil + return nil, errors.New("") } return &res, responseMock.Error diff --git a/pkg/cmd/files/files.go b/internal/cmd/files/files.go similarity index 75% rename from pkg/cmd/files/files.go rename to internal/cmd/files/files.go index ba4e889e..368322bf 100644 --- a/pkg/cmd/files/files.go +++ b/internal/cmd/files/files.go @@ -1,9 +1,9 @@ package files import ( - "github.com/debricked/cli/pkg/client" - "github.com/debricked/cli/pkg/cmd/files/find" - "github.com/debricked/cli/pkg/file" + "github.com/debricked/cli/internal/client" + "github.com/debricked/cli/internal/cmd/files/find" + "github.com/debricked/cli/internal/file" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/pkg/cmd/files/files_test.go b/internal/cmd/files/files_test.go similarity index 84% rename from pkg/cmd/files/files_test.go rename to internal/cmd/files/files_test.go index c177cfb3..c3edba29 100644 --- a/pkg/cmd/files/files_test.go +++ b/internal/cmd/files/files_test.go @@ -3,8 +3,8 @@ package files import ( "testing" - "github.com/debricked/cli/pkg/client" - "github.com/debricked/cli/pkg/client/testdata" + "github.com/debricked/cli/internal/client" + "github.com/debricked/cli/internal/client/testdata" "github.com/stretchr/testify/assert" ) diff --git a/pkg/cmd/files/find/find.go b/internal/cmd/files/find/find.go similarity index 98% rename from pkg/cmd/files/find/find.go rename to internal/cmd/files/find/find.go index eb681dbd..38d8c371 100644 --- a/pkg/cmd/files/find/find.go +++ b/internal/cmd/files/find/find.go @@ -6,7 +6,7 @@ import ( "fmt" "path/filepath" - "github.com/debricked/cli/pkg/file" + "github.com/debricked/cli/internal/file" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/pkg/cmd/files/find/find_test.go b/internal/cmd/files/find/find_test.go similarity index 97% rename from pkg/cmd/files/find/find_test.go rename to internal/cmd/files/find/find_test.go index ef4d1d2c..a0bf72b7 100644 --- a/pkg/cmd/files/find/find_test.go +++ b/internal/cmd/files/find/find_test.go @@ -7,8 +7,8 @@ import ( "os" "testing" - "github.com/debricked/cli/pkg/file" - "github.com/debricked/cli/pkg/file/testdata" + "github.com/debricked/cli/internal/file" + "github.com/debricked/cli/internal/file/testdata" "github.com/spf13/viper" "github.com/stretchr/testify/assert" ) diff --git a/pkg/cmd/report/license/license.go b/internal/cmd/report/license/license.go similarity index 93% rename from pkg/cmd/report/license/license.go rename to internal/cmd/report/license/license.go index bae26b8a..cb0ce2e8 100644 --- a/pkg/cmd/report/license/license.go +++ b/internal/cmd/report/license/license.go @@ -3,8 +3,8 @@ package license import ( "fmt" - "github.com/debricked/cli/pkg/report" - "github.com/debricked/cli/pkg/report/license" + "github.com/debricked/cli/internal/report" + "github.com/debricked/cli/internal/report/license" "github.com/fatih/color" "github.com/spf13/cobra" "github.com/spf13/viper" diff --git a/pkg/cmd/report/license/license_test.go b/internal/cmd/report/license/license_test.go similarity index 92% rename from pkg/cmd/report/license/license_test.go rename to internal/cmd/report/license/license_test.go index 0e3d222c..5896988b 100644 --- a/pkg/cmd/report/license/license_test.go +++ b/internal/cmd/report/license/license_test.go @@ -4,8 +4,8 @@ import ( "errors" "testing" - "github.com/debricked/cli/pkg/cmd/report/testdata" - "github.com/debricked/cli/pkg/report" + "github.com/debricked/cli/internal/cmd/report/testdata" + "github.com/debricked/cli/internal/report" "github.com/spf13/viper" "github.com/stretchr/testify/assert" ) diff --git a/pkg/cmd/report/report.go b/internal/cmd/report/report.go similarity index 68% rename from pkg/cmd/report/report.go rename to internal/cmd/report/report.go index 86a6411f..1e0da077 100644 --- a/pkg/cmd/report/report.go +++ b/internal/cmd/report/report.go @@ -1,11 +1,11 @@ package report import ( - "github.com/debricked/cli/pkg/client" - "github.com/debricked/cli/pkg/cmd/report/license" - "github.com/debricked/cli/pkg/cmd/report/vulnerability" - licenseReport "github.com/debricked/cli/pkg/report/license" - vulnerabilityReport "github.com/debricked/cli/pkg/report/vulnerability" + "github.com/debricked/cli/internal/client" + "github.com/debricked/cli/internal/cmd/report/license" + "github.com/debricked/cli/internal/cmd/report/vulnerability" + licenseReport "github.com/debricked/cli/internal/report/license" + vulnerabilityReport "github.com/debricked/cli/internal/report/vulnerability" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/pkg/cmd/report/report_test.go b/internal/cmd/report/report_test.go similarity index 83% rename from pkg/cmd/report/report_test.go rename to internal/cmd/report/report_test.go index 768861d3..7d18e983 100644 --- a/pkg/cmd/report/report_test.go +++ b/internal/cmd/report/report_test.go @@ -3,8 +3,8 @@ package report import ( "testing" - "github.com/debricked/cli/pkg/client" - "github.com/debricked/cli/pkg/client/testdata" + "github.com/debricked/cli/internal/client" + "github.com/debricked/cli/internal/client/testdata" "github.com/stretchr/testify/assert" ) diff --git a/pkg/cmd/report/testdata/reporter_mock.go b/internal/cmd/report/testdata/reporter_mock.go similarity index 83% rename from pkg/cmd/report/testdata/reporter_mock.go rename to internal/cmd/report/testdata/reporter_mock.go index 8870e0b0..5c4e9bd6 100644 --- a/pkg/cmd/report/testdata/reporter_mock.go +++ b/internal/cmd/report/testdata/reporter_mock.go @@ -1,6 +1,6 @@ package testdata -import "github.com/debricked/cli/pkg/report" +import "github.com/debricked/cli/internal/report" type ReporterMock struct { err error diff --git a/pkg/cmd/report/vulnerability/vulnerability.go b/internal/cmd/report/vulnerability/vulnerability.go similarity index 92% rename from pkg/cmd/report/vulnerability/vulnerability.go rename to internal/cmd/report/vulnerability/vulnerability.go index 3f5c9797..f5174b06 100644 --- a/pkg/cmd/report/vulnerability/vulnerability.go +++ b/internal/cmd/report/vulnerability/vulnerability.go @@ -3,8 +3,8 @@ package vulnerability import ( "fmt" - "github.com/debricked/cli/pkg/report" - "github.com/debricked/cli/pkg/report/vulnerability" + "github.com/debricked/cli/internal/report" + "github.com/debricked/cli/internal/report/vulnerability" "github.com/fatih/color" "github.com/spf13/cobra" "github.com/spf13/viper" diff --git a/pkg/cmd/report/vulnerability/vulnerability_test.go b/internal/cmd/report/vulnerability/vulnerability_test.go similarity index 93% rename from pkg/cmd/report/vulnerability/vulnerability_test.go rename to internal/cmd/report/vulnerability/vulnerability_test.go index c2db8316..0071aae7 100644 --- a/pkg/cmd/report/vulnerability/vulnerability_test.go +++ b/internal/cmd/report/vulnerability/vulnerability_test.go @@ -4,8 +4,8 @@ import ( "errors" "testing" - "github.com/debricked/cli/pkg/cmd/report/testdata" - "github.com/debricked/cli/pkg/report" + "github.com/debricked/cli/internal/cmd/report/testdata" + "github.com/debricked/cli/internal/report" "github.com/spf13/viper" "github.com/stretchr/testify/assert" ) diff --git a/pkg/cmd/root/root.go b/internal/cmd/root/root.go similarity index 87% rename from pkg/cmd/root/root.go rename to internal/cmd/root/root.go index 4e2fc0b4..fa98a129 100644 --- a/pkg/cmd/root/root.go +++ b/internal/cmd/root/root.go @@ -1,10 +1,10 @@ package root import ( - "github.com/debricked/cli/pkg/client" - "github.com/debricked/cli/pkg/cmd/files" - "github.com/debricked/cli/pkg/cmd/report" - "github.com/debricked/cli/pkg/cmd/scan" + "github.com/debricked/cli/internal/client" + "github.com/debricked/cli/internal/cmd/files" + "github.com/debricked/cli/internal/cmd/report" + "github.com/debricked/cli/internal/cmd/scan" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/pkg/cmd/root/root_test.go b/internal/cmd/root/root_test.go similarity index 100% rename from pkg/cmd/root/root_test.go rename to internal/cmd/root/root_test.go diff --git a/pkg/cmd/scan/scan.go b/internal/cmd/scan/scan.go similarity index 95% rename from pkg/cmd/scan/scan.go rename to internal/cmd/scan/scan.go index 42c3425b..e271ce01 100644 --- a/pkg/cmd/scan/scan.go +++ b/internal/cmd/scan/scan.go @@ -5,10 +5,10 @@ import ( "fmt" "path/filepath" - "github.com/debricked/cli/pkg/ci" - "github.com/debricked/cli/pkg/client" - "github.com/debricked/cli/pkg/file" - "github.com/debricked/cli/pkg/scan" + "github.com/debricked/cli/internal/ci" + "github.com/debricked/cli/internal/client" + "github.com/debricked/cli/internal/file" + "github.com/debricked/cli/internal/scan" "github.com/fatih/color" "github.com/spf13/cobra" "github.com/spf13/viper" diff --git a/pkg/cmd/scan/scan_test.go b/internal/cmd/scan/scan_test.go similarity index 93% rename from pkg/cmd/scan/scan_test.go rename to internal/cmd/scan/scan_test.go index 5c12e535..6186206b 100644 --- a/pkg/cmd/scan/scan_test.go +++ b/internal/cmd/scan/scan_test.go @@ -3,9 +3,9 @@ package scan import ( "testing" - "github.com/debricked/cli/pkg/client" - "github.com/debricked/cli/pkg/client/testdata" - "github.com/debricked/cli/pkg/scan" + "github.com/debricked/cli/internal/client" + "github.com/debricked/cli/internal/client/testdata" + "github.com/debricked/cli/internal/scan" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/stretchr/testify/assert" diff --git a/pkg/file/default_exclusion.go b/internal/file/default_exclusion.go similarity index 100% rename from pkg/file/default_exclusion.go rename to internal/file/default_exclusion.go diff --git a/pkg/file/default_exclusion_test.go b/internal/file/default_exclusion_test.go similarity index 100% rename from pkg/file/default_exclusion_test.go rename to internal/file/default_exclusion_test.go diff --git a/pkg/file/finder.go b/internal/file/finder.go similarity index 98% rename from pkg/file/finder.go rename to internal/file/finder.go index ebe9adb9..9e9c2575 100644 --- a/pkg/file/finder.go +++ b/internal/file/finder.go @@ -10,7 +10,7 @@ import ( "path/filepath" "github.com/bmatcuk/doublestar/v4" - "github.com/debricked/cli/pkg/client" + "github.com/debricked/cli/internal/client" ) type IFinder interface { diff --git a/pkg/file/finder_test.go b/internal/file/finder_test.go similarity index 99% rename from pkg/file/finder_test.go rename to internal/file/finder_test.go index b5d3bb67..6ecb2166 100644 --- a/pkg/file/finder_test.go +++ b/internal/file/finder_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/debricked/cli/pkg/client/testdata" + "github.com/debricked/cli/internal/client/testdata" "github.com/stretchr/testify/assert" ) diff --git a/pkg/file/format.go b/internal/file/format.go similarity index 97% rename from pkg/file/format.go rename to internal/file/format.go index b2288cea..e3b37f5f 100644 --- a/pkg/file/format.go +++ b/internal/file/format.go @@ -6,7 +6,7 @@ import ( "regexp/syntax" "strings" - "github.com/debricked/cli/pkg/file/pcre" + "github.com/debricked/cli/internal/file/pcre" ) type Format struct { diff --git a/pkg/file/format_test.go b/internal/file/format_test.go similarity index 100% rename from pkg/file/format_test.go rename to internal/file/format_test.go diff --git a/pkg/file/group.go b/internal/file/group.go similarity index 100% rename from pkg/file/group.go rename to internal/file/group.go diff --git a/pkg/file/group_test.go b/internal/file/group_test.go similarity index 100% rename from pkg/file/group_test.go rename to internal/file/group_test.go diff --git a/pkg/file/groups.go b/internal/file/groups.go similarity index 100% rename from pkg/file/groups.go rename to internal/file/groups.go diff --git a/pkg/file/groups_test.go b/internal/file/groups_test.go similarity index 100% rename from pkg/file/groups_test.go rename to internal/file/groups_test.go diff --git a/pkg/file/pcre/pcre.go b/internal/file/pcre/pcre.go similarity index 100% rename from pkg/file/pcre/pcre.go rename to internal/file/pcre/pcre.go diff --git a/pkg/file/pcre/pcre_test.go b/internal/file/pcre/pcre_test.go similarity index 100% rename from pkg/file/pcre/pcre_test.go rename to internal/file/pcre/pcre_test.go diff --git a/pkg/file/testdata/composer/composer.json b/internal/file/testdata/composer/composer.json similarity index 100% rename from pkg/file/testdata/composer/composer.json rename to internal/file/testdata/composer/composer.json diff --git a/pkg/file/testdata/composer/composer.lock b/internal/file/testdata/composer/composer.lock similarity index 100% rename from pkg/file/testdata/composer/composer.lock rename to internal/file/testdata/composer/composer.lock diff --git a/pkg/file/testdata/finder_mock.go b/internal/file/testdata/finder_mock.go similarity index 95% rename from pkg/file/testdata/finder_mock.go rename to internal/file/testdata/finder_mock.go index f929b587..8cd8492e 100644 --- a/pkg/file/testdata/finder_mock.go +++ b/internal/file/testdata/finder_mock.go @@ -1,7 +1,7 @@ package testdata import ( - "github.com/debricked/cli/pkg/file" + "github.com/debricked/cli/internal/file" ) type FinderMock struct { diff --git a/pkg/file/testdata/go/go.mod b/internal/file/testdata/go/go.mod similarity index 100% rename from pkg/file/testdata/go/go.mod rename to internal/file/testdata/go/go.mod diff --git a/pkg/file/testdata/misc/Cargo.lock b/internal/file/testdata/misc/Cargo.lock similarity index 100% rename from pkg/file/testdata/misc/Cargo.lock rename to internal/file/testdata/misc/Cargo.lock diff --git a/pkg/file/testdata/misc/requirements.txt b/internal/file/testdata/misc/requirements.txt similarity index 100% rename from pkg/file/testdata/misc/requirements.txt rename to internal/file/testdata/misc/requirements.txt diff --git a/pkg/file/testdata/pip/requirements-dev.txt b/internal/file/testdata/pip/requirements-dev.txt similarity index 100% rename from pkg/file/testdata/pip/requirements-dev.txt rename to internal/file/testdata/pip/requirements-dev.txt diff --git a/pkg/file/testdata/pip/requirements-dev.txt.pip.debricked.lock b/internal/file/testdata/pip/requirements-dev.txt.pip.debricked.lock similarity index 100% rename from pkg/file/testdata/pip/requirements-dev.txt.pip.debricked.lock rename to internal/file/testdata/pip/requirements-dev.txt.pip.debricked.lock diff --git a/pkg/file/testdata/pip/requirements.txt b/internal/file/testdata/pip/requirements.txt similarity index 100% rename from pkg/file/testdata/pip/requirements.txt rename to internal/file/testdata/pip/requirements.txt diff --git a/pkg/file/testdata/pip/requirements.txt.pip.debricked.lock b/internal/file/testdata/pip/requirements.txt.pip.debricked.lock similarity index 100% rename from pkg/file/testdata/pip/requirements.txt.pip.debricked.lock rename to internal/file/testdata/pip/requirements.txt.pip.debricked.lock diff --git a/pkg/file/testdata/yarn/yarn.lock b/internal/file/testdata/yarn/yarn.lock similarity index 100% rename from pkg/file/testdata/yarn/yarn.lock rename to internal/file/testdata/yarn/yarn.lock diff --git a/pkg/git/git.go b/internal/git/git.go similarity index 100% rename from pkg/git/git.go rename to internal/git/git.go diff --git a/pkg/git/git_test.go b/internal/git/git_test.go similarity index 100% rename from pkg/git/git_test.go rename to internal/git/git_test.go diff --git a/pkg/git/meta_object.go b/internal/git/meta_object.go similarity index 100% rename from pkg/git/meta_object.go rename to internal/git/meta_object.go diff --git a/pkg/git/meta_object_test.go b/internal/git/meta_object_test.go similarity index 96% rename from pkg/git/meta_object_test.go rename to internal/git/meta_object_test.go index 4e258d40..97ae8804 100644 --- a/pkg/git/meta_object_test.go +++ b/internal/git/meta_object_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "github.com/debricked/cli/pkg/ci/testdata" + "github.com/debricked/cli/internal/ci/testdata" "github.com/stretchr/testify/assert" ) diff --git a/pkg/report/license/report.go b/internal/report/license/report.go similarity index 95% rename from pkg/report/license/report.go rename to internal/report/license/report.go index 53f65bf4..2fc925c6 100644 --- a/pkg/report/license/report.go +++ b/internal/report/license/report.go @@ -7,8 +7,8 @@ import ( "io" "net/http" - "github.com/debricked/cli/pkg/client" - "github.com/debricked/cli/pkg/report" + "github.com/debricked/cli/internal/client" + "github.com/debricked/cli/internal/report" ) var ( diff --git a/pkg/report/license/report_test.go b/internal/report/license/report_test.go similarity index 98% rename from pkg/report/license/report_test.go rename to internal/report/license/report_test.go index 36eb06bd..2bfb2ecf 100644 --- a/pkg/report/license/report_test.go +++ b/internal/report/license/report_test.go @@ -9,7 +9,7 @@ import ( "net/http" "testing" - "github.com/debricked/cli/pkg/client/testdata" + "github.com/debricked/cli/internal/client/testdata" "github.com/stretchr/testify/assert" ) diff --git a/pkg/report/report.go b/internal/report/report.go similarity index 100% rename from pkg/report/report.go rename to internal/report/report.go diff --git a/pkg/report/vulnerability/report.go b/internal/report/vulnerability/report.go similarity index 91% rename from pkg/report/vulnerability/report.go rename to internal/report/vulnerability/report.go index 959ac3b1..7e208d45 100644 --- a/pkg/report/vulnerability/report.go +++ b/internal/report/vulnerability/report.go @@ -5,8 +5,8 @@ import ( "fmt" "net/http" - "github.com/debricked/cli/pkg/client" - "github.com/debricked/cli/pkg/report" + "github.com/debricked/cli/internal/client" + "github.com/debricked/cli/internal/report" ) var ( diff --git a/pkg/report/vulnerability/report_test.go b/internal/report/vulnerability/report_test.go similarity index 96% rename from pkg/report/vulnerability/report_test.go rename to internal/report/vulnerability/report_test.go index 21c73adf..fefb98ce 100644 --- a/pkg/report/vulnerability/report_test.go +++ b/internal/report/vulnerability/report_test.go @@ -6,7 +6,7 @@ import ( "net/http" "testing" - "github.com/debricked/cli/pkg/client/testdata" + "github.com/debricked/cli/internal/client/testdata" "github.com/stretchr/testify/assert" ) diff --git a/pkg/scan/scanner.go b/internal/scan/scanner.go similarity index 92% rename from pkg/scan/scanner.go rename to internal/scan/scanner.go index 3a7d920e..1b2e2a89 100644 --- a/pkg/scan/scanner.go +++ b/internal/scan/scanner.go @@ -6,13 +6,13 @@ import ( "os" "path/filepath" - "github.com/debricked/cli/pkg/ci" - "github.com/debricked/cli/pkg/ci/env" - "github.com/debricked/cli/pkg/client" - "github.com/debricked/cli/pkg/file" - "github.com/debricked/cli/pkg/git" - "github.com/debricked/cli/pkg/tui" - "github.com/debricked/cli/pkg/upload" + "github.com/debricked/cli/internal/ci" + "github.com/debricked/cli/internal/ci/env" + "github.com/debricked/cli/internal/client" + "github.com/debricked/cli/internal/file" + "github.com/debricked/cli/internal/git" + "github.com/debricked/cli/internal/tui" + "github.com/debricked/cli/internal/upload" "github.com/fatih/color" ) diff --git a/pkg/scan/scanner_test.go b/internal/scan/scanner_test.go similarity index 94% rename from pkg/scan/scanner_test.go rename to internal/scan/scanner_test.go index 7e2549e3..6142fc10 100644 --- a/pkg/scan/scanner_test.go +++ b/internal/scan/scanner_test.go @@ -12,21 +12,21 @@ import ( "strings" "testing" - "github.com/debricked/cli/pkg/ci" - "github.com/debricked/cli/pkg/ci/argo" - "github.com/debricked/cli/pkg/ci/azure" - "github.com/debricked/cli/pkg/ci/bitbucket" - "github.com/debricked/cli/pkg/ci/buildkite" - "github.com/debricked/cli/pkg/ci/circleci" - "github.com/debricked/cli/pkg/ci/env" - "github.com/debricked/cli/pkg/ci/github" - "github.com/debricked/cli/pkg/ci/gitlab" - "github.com/debricked/cli/pkg/ci/travis" - "github.com/debricked/cli/pkg/client" - "github.com/debricked/cli/pkg/client/testdata" - "github.com/debricked/cli/pkg/file" - "github.com/debricked/cli/pkg/git" - "github.com/debricked/cli/pkg/upload" + "github.com/debricked/cli/internal/ci" + "github.com/debricked/cli/internal/ci/argo" + "github.com/debricked/cli/internal/ci/azure" + "github.com/debricked/cli/internal/ci/bitbucket" + "github.com/debricked/cli/internal/ci/buildkite" + "github.com/debricked/cli/internal/ci/circleci" + "github.com/debricked/cli/internal/ci/env" + "github.com/debricked/cli/internal/ci/github" + "github.com/debricked/cli/internal/ci/gitlab" + "github.com/debricked/cli/internal/ci/travis" + "github.com/debricked/cli/internal/client" + "github.com/debricked/cli/internal/client/testdata" + "github.com/debricked/cli/internal/file" + "github.com/debricked/cli/internal/git" + "github.com/debricked/cli/internal/upload" "github.com/stretchr/testify/assert" ) @@ -112,7 +112,7 @@ func TestScan(t *testing.T) { outputAssertions := []string{ "Working directory: /", - "cli/pkg/scan", + "cli/internal/scan", "Successfully uploaded", "yarn.lock\n", "Successfully initialized scan\n", diff --git a/pkg/scan/testdata/yarn/package.json b/internal/scan/testdata/yarn/package.json similarity index 100% rename from pkg/scan/testdata/yarn/package.json rename to internal/scan/testdata/yarn/package.json diff --git a/pkg/scan/testdata/yarn/yarn.lock b/internal/scan/testdata/yarn/yarn.lock similarity index 100% rename from pkg/scan/testdata/yarn/yarn.lock rename to internal/scan/testdata/yarn/yarn.lock diff --git a/pkg/tui/dependency.go b/internal/tui/dependency.go similarity index 95% rename from pkg/tui/dependency.go rename to internal/tui/dependency.go index 85af3505..c3be4f0b 100644 --- a/pkg/tui/dependency.go +++ b/internal/tui/dependency.go @@ -3,7 +3,7 @@ package tui import ( "fmt" - "github.com/debricked/cli/pkg/automation" + "github.com/debricked/cli/internal/automation" ) type dependency struct { diff --git a/pkg/tui/dependency_test.go b/internal/tui/dependency_test.go similarity index 98% rename from pkg/tui/dependency_test.go rename to internal/tui/dependency_test.go index 83d53448..6f87edf8 100644 --- a/pkg/tui/dependency_test.go +++ b/internal/tui/dependency_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/debricked/cli/pkg/automation" + "github.com/debricked/cli/internal/automation" "github.com/stretchr/testify/assert" ) diff --git a/pkg/tui/progress_bar.go b/internal/tui/progress_bar.go similarity index 100% rename from pkg/tui/progress_bar.go rename to internal/tui/progress_bar.go diff --git a/pkg/tui/progress_bar_test.go b/internal/tui/progress_bar_test.go similarity index 100% rename from pkg/tui/progress_bar_test.go rename to internal/tui/progress_bar_test.go diff --git a/pkg/tui/rule_card.go b/internal/tui/rule_card.go similarity index 98% rename from pkg/tui/rule_card.go rename to internal/tui/rule_card.go index becae6f0..6251b7be 100644 --- a/pkg/tui/rule_card.go +++ b/internal/tui/rule_card.go @@ -6,7 +6,7 @@ import ( "io" "strings" - "github.com/debricked/cli/pkg/automation" + "github.com/debricked/cli/internal/automation" "github.com/fatih/color" "github.com/jedib0t/go-pretty/v6/list" "github.com/jedib0t/go-pretty/v6/table" diff --git a/pkg/tui/rule_card_test.go b/internal/tui/rule_card_test.go similarity index 98% rename from pkg/tui/rule_card_test.go rename to internal/tui/rule_card_test.go index 850941c1..31a616ea 100644 --- a/pkg/tui/rule_card_test.go +++ b/internal/tui/rule_card_test.go @@ -4,7 +4,7 @@ import ( "bytes" "testing" - "github.com/debricked/cli/pkg/automation" + "github.com/debricked/cli/internal/automation" "github.com/stretchr/testify/assert" ) diff --git a/pkg/tui/vulnerability.go b/internal/tui/vulnerability.go similarity index 100% rename from pkg/tui/vulnerability.go rename to internal/tui/vulnerability.go diff --git a/pkg/upload/batch.go b/internal/upload/batch.go similarity index 97% rename from pkg/upload/batch.go rename to internal/upload/batch.go index a8e7df14..3384e3cb 100644 --- a/pkg/upload/batch.go +++ b/internal/upload/batch.go @@ -15,10 +15,10 @@ import ( "strings" "time" - "github.com/debricked/cli/pkg/client" - "github.com/debricked/cli/pkg/file" - "github.com/debricked/cli/pkg/git" - "github.com/debricked/cli/pkg/tui" + "github.com/debricked/cli/internal/client" + "github.com/debricked/cli/internal/file" + "github.com/debricked/cli/internal/git" + "github.com/debricked/cli/internal/tui" ) var ( diff --git a/pkg/upload/batch_test.go b/internal/upload/batch_test.go similarity index 95% rename from pkg/upload/batch_test.go rename to internal/upload/batch_test.go index c070d1ae..4f9c446a 100644 --- a/pkg/upload/batch_test.go +++ b/internal/upload/batch_test.go @@ -10,10 +10,10 @@ import ( "strings" "testing" - "github.com/debricked/cli/pkg/client" - "github.com/debricked/cli/pkg/client/testdata" - "github.com/debricked/cli/pkg/file" - "github.com/debricked/cli/pkg/git" + "github.com/debricked/cli/internal/client" + "github.com/debricked/cli/internal/client/testdata" + "github.com/debricked/cli/internal/file" + "github.com/debricked/cli/internal/git" "github.com/stretchr/testify/assert" ) diff --git a/pkg/upload/result.go b/internal/upload/result.go similarity index 93% rename from pkg/upload/result.go rename to internal/upload/result.go index 48486806..e58026ad 100644 --- a/pkg/upload/result.go +++ b/internal/upload/result.go @@ -1,7 +1,7 @@ package upload import ( - "github.com/debricked/cli/pkg/automation" + "github.com/debricked/cli/internal/automation" ) type UploadResult struct { diff --git a/pkg/upload/result_test.go b/internal/upload/result_test.go similarity index 100% rename from pkg/upload/result_test.go rename to internal/upload/result_test.go diff --git a/pkg/upload/status.go b/internal/upload/status.go similarity index 94% rename from pkg/upload/status.go rename to internal/upload/status.go index 48d7899a..27cd1953 100644 --- a/pkg/upload/status.go +++ b/internal/upload/status.go @@ -5,7 +5,7 @@ import ( "io" "net/http" - "github.com/debricked/cli/pkg/automation" + "github.com/debricked/cli/internal/automation" ) type uploadStatus struct { diff --git a/pkg/upload/status_test.go b/internal/upload/status_test.go similarity index 100% rename from pkg/upload/status_test.go rename to internal/upload/status_test.go diff --git a/pkg/upload/testdata/misc/requirements.txt b/internal/upload/testdata/misc/requirements.txt similarity index 100% rename from pkg/upload/testdata/misc/requirements.txt rename to internal/upload/testdata/misc/requirements.txt diff --git a/pkg/upload/testdata/yarn/package.json b/internal/upload/testdata/yarn/package.json similarity index 100% rename from pkg/upload/testdata/yarn/package.json rename to internal/upload/testdata/yarn/package.json diff --git a/pkg/upload/testdata/yarn/yarn.lock b/internal/upload/testdata/yarn/yarn.lock similarity index 100% rename from pkg/upload/testdata/yarn/yarn.lock rename to internal/upload/testdata/yarn/yarn.lock diff --git a/pkg/upload/uploader.go b/internal/upload/uploader.go similarity index 89% rename from pkg/upload/uploader.go rename to internal/upload/uploader.go index 714a098d..ea093af4 100644 --- a/pkg/upload/uploader.go +++ b/internal/upload/uploader.go @@ -3,9 +3,9 @@ package upload import ( "errors" - "github.com/debricked/cli/pkg/client" - "github.com/debricked/cli/pkg/file" - "github.com/debricked/cli/pkg/git" + "github.com/debricked/cli/internal/client" + "github.com/debricked/cli/internal/file" + "github.com/debricked/cli/internal/git" ) type IOptions interface{} diff --git a/pkg/upload/uploader_test.go b/internal/upload/uploader_test.go similarity index 95% rename from pkg/upload/uploader_test.go rename to internal/upload/uploader_test.go index aa8e7710..c7e9be53 100644 --- a/pkg/upload/uploader_test.go +++ b/internal/upload/uploader_test.go @@ -8,10 +8,10 @@ import ( "strings" "testing" - "github.com/debricked/cli/pkg/client" - "github.com/debricked/cli/pkg/client/testdata" - "github.com/debricked/cli/pkg/file" - "github.com/debricked/cli/pkg/git" + "github.com/debricked/cli/internal/client" + "github.com/debricked/cli/internal/client/testdata" + "github.com/debricked/cli/internal/file" + "github.com/debricked/cli/internal/git" "github.com/stretchr/testify/assert" )