diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 00000000..b5f2390a --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,30 @@ +# Run static checks +# +# These actions are skipped for draft PRs. +# See https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/19 +name: lint +on: + push: + branches: [main] + pull_request: + types: [opened, synchronize, reopened, ready_for_review] +jobs: + golangci-lint: + # See https://github.com/golangci/golangci-lint-action + # TODO(wallrj) Timeout is increased to 3m because the action sometimes takes + # a long time. Remove this when the upstream issue is resolved. + # See https://github.com/golangci/golangci-lint-action/issues/297 + name: golangci-lint + runs-on: ubuntu-22.04 + if: github.event.pull_request.draft == false + steps: + - uses: actions/checkout@v3 + # Set up Go so that golangci-lint has the right $GOROOT and can find + # the right standard libraries. See: + # https://github.com/reviewdog/action-golangci-lint/issues/73#issuecomment-813386935 + - uses: actions/setup-go@v4 + with: + go-version-file: go.mod + - uses: golangci/golangci-lint-action@v3.4.0 + with: + args: --verbose --timeout=3m diff --git a/.golangci.yml b/.golangci.yml index 1b834fbd..56d22bf0 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -8,6 +8,7 @@ linters: - varcheck - unused enable: + - gci - gosec issues: @@ -26,4 +27,13 @@ issues: - gosec - text: "h.Write" linters: - - errcheck \ No newline at end of file + - errcheck + +linters-settings: + gci: + sections: + - standard # Standard section: captures all standard packages. + - default # Default section: contains all imports that could not be matched to another section type. + - prefix(github.com/Venafi/vcert) # Custom section: groups all imports with the specified Prefix. + - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled. + - dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled. \ No newline at end of file diff --git a/client.go b/client.go index 3ca0f9fd..cbec5c66 100644 --- a/client.go +++ b/client.go @@ -19,12 +19,13 @@ package vcert import ( "crypto/x509" "fmt" + "log" + "github.com/Venafi/vcert/v4/pkg/endpoint" "github.com/Venafi/vcert/v4/pkg/venafi/cloud" "github.com/Venafi/vcert/v4/pkg/venafi/fake" "github.com/Venafi/vcert/v4/pkg/venafi/tpp" "github.com/Venafi/vcert/v4/pkg/verror" - "log" ) type newClientArgs struct { diff --git a/client_test.go b/client_test.go index 9383350b..779019f7 100644 --- a/client_test.go +++ b/client_test.go @@ -21,13 +21,14 @@ import ( "crypto/x509/pkix" "encoding/json" "fmt" - "github.com/Venafi/vcert/v4/pkg/certificate" - "github.com/Venafi/vcert/v4/pkg/endpoint" "io/ioutil" "net/http" "os" "testing" "time" + + "github.com/Venafi/vcert/v4/pkg/certificate" + "github.com/Venafi/vcert/v4/pkg/endpoint" ) func init() { diff --git a/cmd/vcert/commands.go b/cmd/vcert/commands.go index f61e8960..9491e333 100644 --- a/cmd/vcert/commands.go +++ b/cmd/vcert/commands.go @@ -22,9 +22,6 @@ import ( "encoding/json" "encoding/pem" "fmt" - "github.com/Venafi/vcert/v4/pkg/venafi/cloud" - "github.com/Venafi/vcert/v4/pkg/venafi/fake" - "github.com/Venafi/vcert/v4/pkg/venafi/tpp" "io/ioutil" "log" "net" @@ -34,15 +31,18 @@ import ( "strings" "time" - "github.com/Venafi/vcert/v4/pkg/policy" - "github.com/Venafi/vcert/v4/pkg/util" + "github.com/urfave/cli/v2" + "golang.org/x/crypto/pkcs12" "gopkg.in/yaml.v2" "github.com/Venafi/vcert/v4" "github.com/Venafi/vcert/v4/pkg/certificate" "github.com/Venafi/vcert/v4/pkg/endpoint" - "github.com/urfave/cli/v2" - "golang.org/x/crypto/pkcs12" + "github.com/Venafi/vcert/v4/pkg/policy" + "github.com/Venafi/vcert/v4/pkg/util" + "github.com/Venafi/vcert/v4/pkg/venafi/cloud" + "github.com/Venafi/vcert/v4/pkg/venafi/fake" + "github.com/Venafi/vcert/v4/pkg/venafi/tpp" ) var ( diff --git a/cmd/vcert/main.go b/cmd/vcert/main.go index c2d1b976..12a4f844 100644 --- a/cmd/vcert/main.go +++ b/cmd/vcert/main.go @@ -23,8 +23,9 @@ import ( "sort" "time" - "github.com/Venafi/vcert/v4" "github.com/urfave/cli/v2" + + "github.com/Venafi/vcert/v4" ) var ( diff --git a/cmd/vcert/result_writer.go b/cmd/vcert/result_writer.go index 9d1aa17b..bd51c8cd 100644 --- a/cmd/vcert/result_writer.go +++ b/cmd/vcert/result_writer.go @@ -23,15 +23,16 @@ import ( "encoding/json" "encoding/pem" "fmt" - "github.com/Venafi/vcert/v4/pkg/util" "io/ioutil" "os" "strings" "time" - "github.com/Venafi/vcert/v4/pkg/certificate" "github.com/pavel-v-chernykh/keystore-go/v4" "software.sslmate.com/src/go-pkcs12" + + "github.com/Venafi/vcert/v4/pkg/certificate" + "github.com/Venafi/vcert/v4/pkg/util" ) type Config struct { diff --git a/cmd/vcert/test_utils.go b/cmd/vcert/test_utils.go index 216a006e..a6508a29 100644 --- a/cmd/vcert/test_utils.go +++ b/cmd/vcert/test_utils.go @@ -1,8 +1,9 @@ package main import ( - "github.com/urfave/cli/v2" "os" + + "github.com/urfave/cli/v2" ) const ( diff --git a/cmd/vcert/utils.go b/cmd/vcert/utils.go index bcce1030..02abc7f5 100644 --- a/cmd/vcert/utils.go +++ b/cmd/vcert/utils.go @@ -33,13 +33,13 @@ import ( "strings" "time" + "github.com/spf13/viper" + "github.com/urfave/cli/v2" + "github.com/Venafi/vcert/v4" "github.com/Venafi/vcert/v4/pkg/certificate" "github.com/Venafi/vcert/v4/pkg/endpoint" "github.com/Venafi/vcert/v4/pkg/util" - - "github.com/spf13/viper" - "github.com/urfave/cli/v2" ) const ( diff --git a/cmd/vcert/validators.go b/cmd/vcert/validators.go index 5c9e7483..b111aeb2 100644 --- a/cmd/vcert/validators.go +++ b/cmd/vcert/validators.go @@ -19,13 +19,13 @@ package main import ( "bufio" "fmt" - "github.com/Venafi/vcert/v4/pkg/util" "io/ioutil" "os" "regexp" "strings" "github.com/Venafi/vcert/v4/pkg/certificate" + "github.com/Venafi/vcert/v4/pkg/util" ) // RevocationReasonOptions is an array of strings containing reasons for certificate revocation diff --git a/config.go b/config.go index 612c22e4..35ee25c6 100644 --- a/config.go +++ b/config.go @@ -24,8 +24,9 @@ import ( "os/user" "path/filepath" - "github.com/Venafi/vcert/v4/pkg/endpoint" "gopkg.in/ini.v1" + + "github.com/Venafi/vcert/v4/pkg/endpoint" ) // Config is a basic structure for high level initiating connector to Trust Platform (TPP)/Venafi Cloud diff --git a/examples/server/main.go b/examples/server/main.go index 8cb82bdd..c69ad7bc 100644 --- a/examples/server/main.go +++ b/examples/server/main.go @@ -2,12 +2,13 @@ package main import ( "fmt" - "github.com/Venafi/vcert/v4" - "github.com/Venafi/vcert/v4/pkg/endpoint" "io/ioutil" "log" "net/http" "os" + + "github.com/Venafi/vcert/v4" + "github.com/Venafi/vcert/v4/pkg/endpoint" ) func main() { diff --git a/examples/simple-cli/main.go b/examples/simple-cli/main.go index f3874231..ddf561c5 100644 --- a/examples/simple-cli/main.go +++ b/examples/simple-cli/main.go @@ -22,10 +22,6 @@ import ( "crypto/x509/pkix" "encoding/pem" "fmt" - "github.com/Venafi/vcert/v4" - "github.com/Venafi/vcert/v4/pkg/certificate" - "github.com/Venafi/vcert/v4/pkg/endpoint" - "github.com/Venafi/vcert/v4/pkg/venafi/tpp" "io/ioutil" t "log" "math/big" @@ -33,6 +29,11 @@ import ( "os" "strings" "time" + + "github.com/Venafi/vcert/v4" + "github.com/Venafi/vcert/v4/pkg/certificate" + "github.com/Venafi/vcert/v4/pkg/endpoint" + "github.com/Venafi/vcert/v4/pkg/venafi/tpp" ) func main() { diff --git a/examples/simple-cli/main_test.go b/examples/simple-cli/main_test.go index 27f43013..fe14de99 100644 --- a/examples/simple-cli/main_test.go +++ b/examples/simple-cli/main_test.go @@ -21,12 +21,13 @@ import ( "crypto/x509" "crypto/x509/pkix" "encoding/pem" - "github.com/Venafi/vcert/v4" - "github.com/Venafi/vcert/v4/pkg/certificate" - "github.com/Venafi/vcert/v4/test" "net/http" "testing" "time" + + "github.com/Venafi/vcert/v4" + "github.com/Venafi/vcert/v4/pkg/certificate" + "github.com/Venafi/vcert/v4/test" ) var effectiveConfig *vcert.Config diff --git a/examples/simple-cli/vars.go b/examples/simple-cli/vars.go index 7d3831b5..54f5a45b 100644 --- a/examples/simple-cli/vars.go +++ b/examples/simple-cli/vars.go @@ -19,11 +19,12 @@ package main import ( "encoding/json" "fmt" - "github.com/Venafi/vcert/v4" - "github.com/Venafi/vcert/v4/pkg/endpoint" "io/ioutil" "log" "os" + + "github.com/Venafi/vcert/v4" + "github.com/Venafi/vcert/v4/pkg/endpoint" ) var mockConfig, cloudConfig, tppConfig *vcert.Config diff --git a/go.mod b/go.mod index 746d56b6..1f5aed65 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,7 @@ module github.com/Venafi/vcert/v4 +go 1.18 + require ( github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c github.com/pavel-v-chernykh/keystore-go/v4 v4.1.0 @@ -13,4 +15,21 @@ require ( software.sslmate.com/src/go-pkcs12 v0.0.0-20180114231543-2291e8f0f237 ) -go 1.13 +require ( + github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect + github.com/fsnotify/fsnotify v1.4.7 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/magiconair/properties v1.8.1 // indirect + github.com/mitchellh/mapstructure v1.1.2 // indirect + github.com/pelletier/go-toml v1.2.0 // indirect + github.com/russross/blackfriday/v2 v2.0.1 // indirect + github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect + github.com/spf13/afero v1.1.2 // indirect + github.com/spf13/cast v1.3.0 // indirect + github.com/spf13/jwalterweatherman v1.0.0 // indirect + github.com/spf13/pflag v1.0.3 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect + golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect + golang.org/x/text v0.3.3 // indirect +) diff --git a/go.sum b/go.sum index 0f1643e9..c90f8b76 100644 --- a/go.sum +++ b/go.sum @@ -232,7 +232,6 @@ golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= diff --git a/listener.go b/listener.go index ede829b0..9dc12f9a 100644 --- a/listener.go +++ b/listener.go @@ -4,12 +4,13 @@ import ( "crypto/tls" "crypto/x509/pkix" "fmt" - "github.com/Venafi/vcert/v4/pkg/certificate" - "github.com/Venafi/vcert/v4/pkg/endpoint" - "github.com/Venafi/vcert/v4/pkg/util" "log" "net" "time" + + "github.com/Venafi/vcert/v4/pkg/certificate" + "github.com/Venafi/vcert/v4/pkg/endpoint" + "github.com/Venafi/vcert/v4/pkg/util" ) // NewListener returns a net.Listener that listens on the first port diff --git a/listener_test.go b/listener_test.go index 4371283a..68e285ba 100644 --- a/listener_test.go +++ b/listener_test.go @@ -4,12 +4,13 @@ import ( "crypto/tls" "crypto/x509" "fmt" - "github.com/Venafi/vcert/v4/pkg/endpoint" - "github.com/Venafi/vcert/v4/pkg/venafi/fake" "io/ioutil" "net/http" "testing" "time" + + "github.com/Venafi/vcert/v4/pkg/endpoint" + "github.com/Venafi/vcert/v4/pkg/venafi/fake" ) func TestConfig_NewListener(t *testing.T) { diff --git a/pkg/certificate/certificate.go b/pkg/certificate/certificate.go index cdf6509a..f994e674 100644 --- a/pkg/certificate/certificate.go +++ b/pkg/certificate/certificate.go @@ -29,15 +29,14 @@ import ( "fmt" "net" "net/url" + "reflect" + "sort" "strings" "time" - "github.com/Venafi/vcert/v4/pkg/util" "github.com/youmark/pkcs8" - "reflect" - "sort" - + "github.com/Venafi/vcert/v4/pkg/util" "github.com/Venafi/vcert/v4/pkg/verror" ) diff --git a/pkg/certificate/certificateCollection.go b/pkg/certificate/certificateCollection.go index 07a77fd1..926c04b6 100644 --- a/pkg/certificate/certificateCollection.go +++ b/pkg/certificate/certificateCollection.go @@ -22,8 +22,9 @@ import ( "crypto/x509" "encoding/pem" "fmt" - "github.com/Venafi/vcert/v4/pkg/verror" "strings" + + "github.com/Venafi/vcert/v4/pkg/verror" ) // ChainOption represents the options to be used with the certificate chain diff --git a/pkg/endpoint/endpoint.go b/pkg/endpoint/endpoint.go index f39c0f1c..c58e8e3f 100644 --- a/pkg/endpoint/endpoint.go +++ b/pkg/endpoint/endpoint.go @@ -29,9 +29,8 @@ import ( "regexp" "time" - "github.com/Venafi/vcert/v4/pkg/policy" - "github.com/Venafi/vcert/v4/pkg/certificate" + "github.com/Venafi/vcert/v4/pkg/policy" ) const SDKName = "Venafi VCert-Go" diff --git a/pkg/endpoint/endpoint_validator_test.go b/pkg/endpoint/endpoint_validator_test.go index cfda358c..4aa5f9cf 100644 --- a/pkg/endpoint/endpoint_validator_test.go +++ b/pkg/endpoint/endpoint_validator_test.go @@ -2,8 +2,9 @@ package endpoint import ( "crypto/x509/pkix" - "github.com/Venafi/vcert/v4/pkg/certificate" "testing" + + "github.com/Venafi/vcert/v4/pkg/certificate" ) var any = []string{`.*`} diff --git a/pkg/policy/policySpecification_test.go b/pkg/policy/policySpecification_test.go index 3244360a..384e1557 100644 --- a/pkg/policy/policySpecification_test.go +++ b/pkg/policy/policySpecification_test.go @@ -3,12 +3,13 @@ package policy import ( "encoding/json" "fmt" - "github.com/smartystreets/assertions" - "gopkg.in/yaml.v2" t "log" "path/filepath" "strings" "testing" + + "github.com/smartystreets/assertions" + "gopkg.in/yaml.v2" ) func getPolicySpecificationFromFile(f string) *PolicySpecification { diff --git a/pkg/policy/policyUtils.go b/pkg/policy/policyUtils.go index 86c262d0..5ea2893d 100644 --- a/pkg/policy/policyUtils.go +++ b/pkg/policy/policyUtils.go @@ -3,12 +3,13 @@ package policy import ( "encoding/json" "fmt" - "gopkg.in/yaml.v2" "io/ioutil" "os" "path/filepath" "strconv" "strings" + + "gopkg.in/yaml.v2" ) // there is no way for creating an array as constant, so creating a variable diff --git a/pkg/util/sshKeyGenerator.go b/pkg/util/sshKeyGenerator.go index 0df18487..6782deca 100644 --- a/pkg/util/sshKeyGenerator.go +++ b/pkg/util/sshKeyGenerator.go @@ -6,10 +6,10 @@ import ( "crypto/x509" "encoding/pem" "fmt" - "github.com/youmark/pkcs8" "log" "strings" + "github.com/youmark/pkcs8" "golang.org/x/crypto/ssh" ) diff --git a/pkg/util/sshKeyGenerator_test.go b/pkg/util/sshKeyGenerator_test.go index 27fc0213..e4da6fdd 100644 --- a/pkg/util/sshKeyGenerator_test.go +++ b/pkg/util/sshKeyGenerator_test.go @@ -2,8 +2,9 @@ package util import ( "fmt" - "github.com/smartystreets/assertions" "testing" + + "github.com/smartystreets/assertions" ) func TestGenerateSshKeyPair(t *testing.T) { diff --git a/pkg/util/utils.go b/pkg/util/utils.go index 95656d0d..89b187c9 100644 --- a/pkg/util/utils.go +++ b/pkg/util/utils.go @@ -8,8 +8,9 @@ import ( "encoding/json" "encoding/pem" "fmt" - "github.com/youmark/pkcs8" "time" + + "github.com/youmark/pkcs8" ) const LegacyPem = "legacy-pem" diff --git a/pkg/venafi/cloud/cloud.go b/pkg/venafi/cloud/cloud.go index d3dece20..c8efe981 100644 --- a/pkg/venafi/cloud/cloud.go +++ b/pkg/venafi/cloud/cloud.go @@ -32,13 +32,11 @@ import ( "strings" "time" + "github.com/Venafi/vcert/v4/pkg/certificate" + "github.com/Venafi/vcert/v4/pkg/endpoint" "github.com/Venafi/vcert/v4/pkg/policy" "github.com/Venafi/vcert/v4/pkg/util" - "github.com/Venafi/vcert/v4/pkg/verror" - - "github.com/Venafi/vcert/v4/pkg/certificate" - "github.com/Venafi/vcert/v4/pkg/endpoint" ) type apiKey struct { diff --git a/pkg/venafi/cloud/cloudUtil.go b/pkg/venafi/cloud/cloudUtil.go index 17363c8a..7e724f38 100644 --- a/pkg/venafi/cloud/cloudUtil.go +++ b/pkg/venafi/cloud/cloudUtil.go @@ -3,10 +3,11 @@ package cloud import ( "encoding/json" "fmt" - "github.com/Venafi/vcert/v4/pkg/certificate" - "github.com/Venafi/vcert/v4/pkg/util" "net/http" "regexp" + + "github.com/Venafi/vcert/v4/pkg/certificate" + "github.com/Venafi/vcert/v4/pkg/util" ) func parseCertificateInfo(httpStatusCode int, httpStatus string, body []byte) (*managedCertificate, error) { diff --git a/pkg/venafi/cloud/company.go b/pkg/venafi/cloud/company.go index a8d62187..bd302d47 100644 --- a/pkg/venafi/cloud/company.go +++ b/pkg/venafi/cloud/company.go @@ -17,8 +17,9 @@ package cloud import ( - "github.com/Venafi/vcert/v4/pkg/endpoint" "time" + + "github.com/Venafi/vcert/v4/pkg/endpoint" ) type company struct { diff --git a/pkg/venafi/cloud/connector.go b/pkg/venafi/cloud/connector.go index 1b89c802..9053039a 100644 --- a/pkg/venafi/cloud/connector.go +++ b/pkg/venafi/cloud/connector.go @@ -33,13 +33,13 @@ import ( "strings" "time" + "golang.org/x/crypto/nacl/box" + "github.com/Venafi/vcert/v4/pkg/certificate" "github.com/Venafi/vcert/v4/pkg/endpoint" "github.com/Venafi/vcert/v4/pkg/policy" "github.com/Venafi/vcert/v4/pkg/util" "github.com/Venafi/vcert/v4/pkg/verror" - - "golang.org/x/crypto/nacl/box" ) type urlResource string diff --git a/pkg/venafi/cloud/connector_test.go b/pkg/venafi/cloud/connector_test.go index 89dac5f7..a78853d5 100644 --- a/pkg/venafi/cloud/connector_test.go +++ b/pkg/venafi/cloud/connector_test.go @@ -36,10 +36,9 @@ import ( "testing" "time" - "github.com/Venafi/vcert/v4/pkg/policy" - "github.com/Venafi/vcert/v4/pkg/certificate" "github.com/Venafi/vcert/v4/pkg/endpoint" + "github.com/Venafi/vcert/v4/pkg/policy" "github.com/Venafi/vcert/v4/pkg/util" "github.com/Venafi/vcert/v4/pkg/verror" "github.com/Venafi/vcert/v4/test" diff --git a/pkg/venafi/cloud/error.go b/pkg/venafi/cloud/error.go index b72d2326..9cd98588 100644 --- a/pkg/venafi/cloud/error.go +++ b/pkg/venafi/cloud/error.go @@ -19,6 +19,7 @@ package cloud import ( "encoding/json" "fmt" + "github.com/Venafi/vcert/v4/pkg/verror" ) diff --git a/pkg/venafi/cloud/search.go b/pkg/venafi/cloud/search.go index 6cc33b63..b6478fb6 100644 --- a/pkg/venafi/cloud/search.go +++ b/pkg/venafi/cloud/search.go @@ -19,12 +19,13 @@ package cloud import ( "encoding/json" "fmt" - "github.com/Venafi/vcert/v4/pkg/certificate" "log" "math" "net/http" "strings" "time" + + "github.com/Venafi/vcert/v4/pkg/certificate" ) type SearchRequest struct { diff --git a/pkg/venafi/cloud/search_test.go b/pkg/venafi/cloud/search_test.go index d230e7f6..31a6801b 100644 --- a/pkg/venafi/cloud/search_test.go +++ b/pkg/venafi/cloud/search_test.go @@ -18,10 +18,11 @@ package cloud import ( "encoding/json" - "github.com/Venafi/vcert/v4/pkg/certificate" - "github.com/Venafi/vcert/v4/pkg/util" "testing" "time" + + "github.com/Venafi/vcert/v4/pkg/certificate" + "github.com/Venafi/vcert/v4/pkg/util" ) func TestSearchRequest(t *testing.T) { diff --git a/pkg/venafi/fake/connector.go b/pkg/venafi/fake/connector.go index bf905911..f9be3fc7 100644 --- a/pkg/venafi/fake/connector.go +++ b/pkg/venafi/fake/connector.go @@ -29,10 +29,9 @@ import ( "strings" "time" - "github.com/Venafi/vcert/v4/pkg/policy" - "github.com/Venafi/vcert/v4/pkg/certificate" "github.com/Venafi/vcert/v4/pkg/endpoint" + "github.com/Venafi/vcert/v4/pkg/policy" ) type Connector struct { diff --git a/pkg/venafi/fake/connector_test.go b/pkg/venafi/fake/connector_test.go index 9e2fcd72..1b76b1b2 100644 --- a/pkg/venafi/fake/connector_test.go +++ b/pkg/venafi/fake/connector_test.go @@ -18,9 +18,10 @@ package fake import ( "fmt" - "github.com/Venafi/vcert/v4/pkg/certificate" "testing" "time" + + "github.com/Venafi/vcert/v4/pkg/certificate" ) func TestRetrieveCertificate(t *testing.T) { diff --git a/pkg/venafi/fake/fake.go b/pkg/venafi/fake/fake.go index cc58d513..fe4d30ac 100644 --- a/pkg/venafi/fake/fake.go +++ b/pkg/venafi/fake/fake.go @@ -18,6 +18,7 @@ package fake import ( "fmt" + "github.com/Venafi/vcert/v4/pkg/certificate" "github.com/Venafi/vcert/v4/pkg/endpoint" ) diff --git a/pkg/venafi/fake/fake_test.go b/pkg/venafi/fake/fake_test.go index 271f4ea0..3feb529d 100644 --- a/pkg/venafi/fake/fake_test.go +++ b/pkg/venafi/fake/fake_test.go @@ -17,8 +17,9 @@ package fake import ( - "github.com/Venafi/vcert/v4/pkg/certificate" "testing" + + "github.com/Venafi/vcert/v4/pkg/certificate" ) func TestGenerateRequest(t *testing.T) { diff --git a/pkg/venafi/tpp/connector.go b/pkg/venafi/tpp/connector.go index 34e68270..86e362c8 100644 --- a/pkg/venafi/tpp/connector.go +++ b/pkg/venafi/tpp/connector.go @@ -30,11 +30,10 @@ import ( "strings" "time" - "github.com/Venafi/vcert/v4/pkg/policy" - "github.com/Venafi/vcert/v4/pkg/util" - "github.com/Venafi/vcert/v4/pkg/certificate" "github.com/Venafi/vcert/v4/pkg/endpoint" + "github.com/Venafi/vcert/v4/pkg/policy" + "github.com/Venafi/vcert/v4/pkg/util" "github.com/Venafi/vcert/v4/pkg/verror" ) diff --git a/pkg/venafi/tpp/connector_test.go b/pkg/venafi/tpp/connector_test.go index 368f9ee1..45ec9da9 100644 --- a/pkg/venafi/tpp/connector_test.go +++ b/pkg/venafi/tpp/connector_test.go @@ -40,11 +40,10 @@ import ( "testing" "time" - "github.com/Venafi/vcert/v4/pkg/policy" - "github.com/Venafi/vcert/v4/pkg/util" - "github.com/Venafi/vcert/v4/pkg/certificate" "github.com/Venafi/vcert/v4/pkg/endpoint" + "github.com/Venafi/vcert/v4/pkg/policy" + "github.com/Venafi/vcert/v4/pkg/util" "github.com/Venafi/vcert/v4/pkg/verror" "github.com/Venafi/vcert/v4/test" ) diff --git a/pkg/venafi/tpp/search.go b/pkg/venafi/tpp/search.go index a8f4b80c..626f9e3b 100644 --- a/pkg/venafi/tpp/search.go +++ b/pkg/venafi/tpp/search.go @@ -21,11 +21,12 @@ import ( "encoding/json" "encoding/pem" "fmt" - "github.com/Venafi/vcert/v4/pkg/certificate" "net/http" neturl "net/url" "strings" "time" + + "github.com/Venafi/vcert/v4/pkg/certificate" ) type SearchRequest []string diff --git a/pkg/venafi/tpp/tpp.go b/pkg/venafi/tpp/tpp.go index db6cf8f9..46f953df 100644 --- a/pkg/venafi/tpp/tpp.go +++ b/pkg/venafi/tpp/tpp.go @@ -32,10 +32,9 @@ import ( "strings" "time" - "github.com/Venafi/vcert/v4/pkg/policy" - "github.com/Venafi/vcert/v4/pkg/certificate" "github.com/Venafi/vcert/v4/pkg/endpoint" + "github.com/Venafi/vcert/v4/pkg/policy" ) const defaultKeySize = 2048 diff --git a/pkg/venafi/tpp/tpp_test.go b/pkg/venafi/tpp/tpp_test.go index f9bae721..cd330c66 100644 --- a/pkg/venafi/tpp/tpp_test.go +++ b/pkg/venafi/tpp/tpp_test.go @@ -18,11 +18,12 @@ package tpp import ( "crypto/x509" - "github.com/Venafi/vcert/v4/pkg/certificate" - "github.com/Venafi/vcert/v4/pkg/endpoint" "net/http" "strings" "testing" + + "github.com/Venafi/vcert/v4/pkg/certificate" + "github.com/Venafi/vcert/v4/pkg/endpoint" ) const ( diff --git a/test/fixtures.go b/test/fixtures.go index 9c55d643..e7ee953e 100644 --- a/test/fixtures.go +++ b/test/fixtures.go @@ -18,12 +18,13 @@ package test import ( "fmt" - "github.com/Venafi/vcert/v4/pkg/certificate" - "github.com/Venafi/vcert/v4/pkg/policy" "math/rand" "os" "strings" "time" + + "github.com/Venafi/vcert/v4/pkg/certificate" + "github.com/Venafi/vcert/v4/pkg/policy" ) func init() {