From 7414ec328c7be124b6dafbb9970a288f85658ddf Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sat, 9 May 2020 15:50:40 +0200 Subject: [PATCH] chore: update linter. --- .golangci.toml | 2 ++ cmd/boltdb.go | 2 +- cmd/consul.go | 2 +- cmd/doc.go | 2 +- cmd/etcd.go | 2 +- cmd/file.go | 2 +- cmd/kv.go | 2 +- cmd/root.go | 2 +- cmd/version.go | 2 +- cmd/zookeeper.go | 2 +- dumper/kv/convert.go | 10 +++++----- dumper/v1/storeddata.go | 8 ++++---- 12 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.golangci.toml b/.golangci.toml index 98fb35f..e7ad692 100644 --- a/.golangci.toml +++ b/.golangci.toml @@ -31,6 +31,8 @@ "scopelint", "wsl", "gomnd", + "testpackage", + "goerr113", ] [issues] diff --git a/cmd/boltdb.go b/cmd/boltdb.go index fd2044b..cefa57c 100644 --- a/cmd/boltdb.go +++ b/cmd/boltdb.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/cobra" ) -// boltdbCmd represents the boltdb command +// boltdbCmd represents the boltdb command. var boltdbCmd = &cobra.Command{ Use: "boltdb", Short: "Dump the content of BoltDB.", diff --git a/cmd/consul.go b/cmd/consul.go index ef86386..aaf99ae 100644 --- a/cmd/consul.go +++ b/cmd/consul.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/cobra" ) -// consulCmd represents the consul command +// consulCmd represents the consul command. var consulCmd = &cobra.Command{ Use: "consul", Short: "Dump the content of Consul.", diff --git a/cmd/doc.go b/cmd/doc.go index 9218db9..d7dadc0 100644 --- a/cmd/doc.go +++ b/cmd/doc.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/cobra/doc" ) -// docCmd represents the doc command +// docCmd represents the doc command. var docCmd = &cobra.Command{ Use: "doc", Short: "Generate documentation", diff --git a/cmd/etcd.go b/cmd/etcd.go index aeaeb1f..d15483d 100644 --- a/cmd/etcd.go +++ b/cmd/etcd.go @@ -11,7 +11,7 @@ import ( "github.com/spf13/cobra" ) -// etcdCmd represents the etcd command +// etcdCmd represents the etcd command. var etcdCmd = &cobra.Command{ Use: "etcd", Short: "Dump the content of etcd.", diff --git a/cmd/file.go b/cmd/file.go index 9e7ec9a..12bd9fe 100644 --- a/cmd/file.go +++ b/cmd/file.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" ) -// fileCmd represents the file command +// fileCmd represents the file command. var fileCmd = &cobra.Command{ Use: "file", Short: `Dump the content of the "acme.json" file.`, diff --git a/cmd/kv.go b/cmd/kv.go index 963e2d0..b8d62d0 100644 --- a/cmd/kv.go +++ b/cmd/kv.go @@ -14,7 +14,7 @@ import ( "github.com/spf13/cobra" ) -// kvCmd represents the kv command +// kvCmd represents the kv command. var kvCmd = &cobra.Command{ Use: "kv", Short: `Dump the content of a KV store.`, diff --git a/cmd/root.go b/cmd/root.go index 1d24236..1adf604 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -16,7 +16,7 @@ import ( var cfgFile string -// rootCmd represents the base command when called without any subcommands +// rootCmd represents the base command when called without any subcommands. var rootCmd = &cobra.Command{ Use: "traefik-certs-dumper", Short: "Dump Let's Encrypt certificates from Traefik.", diff --git a/cmd/version.go b/cmd/version.go index 2b2b4a8..e7f87f7 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -13,7 +13,7 @@ var ( date = "I don't remember exactly" ) -// versionCmd represents the version command +// versionCmd represents the version command. var versionCmd = &cobra.Command{ Use: "version", Short: "Display version", diff --git a/cmd/zookeeper.go b/cmd/zookeeper.go index 35f5f9d..63fa878 100644 --- a/cmd/zookeeper.go +++ b/cmd/zookeeper.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/cobra" ) -// zookeeperCmd represents the zookeeper command +// zookeeperCmd represents the zookeeper command. var zookeeperCmd = &cobra.Command{ Use: "zookeeper", Short: "Dump the content of zookeeper.", diff --git a/dumper/kv/convert.go b/dumper/kv/convert.go index f802784..da9c62a 100644 --- a/dumper/kv/convert.go +++ b/dumper/kv/convert.go @@ -6,7 +6,7 @@ import ( v1 "github.com/ldez/traefik-certs-dumper/v2/dumper/v1" ) -// CertificateOld is used to store certificate info +// CertificateOld is used to store certificate info. type CertificateOld struct { Domain string CertURL string @@ -15,7 +15,7 @@ type CertificateOld struct { Certificate []byte } -// AccountOld is used to store lets encrypt registration info +// AccountOld is used to store lets encrypt registration info. type AccountOld struct { Email string Registration *registration.Resource @@ -26,18 +26,18 @@ type AccountOld struct { HTTPChallenge map[string]map[string][]byte } -// DomainsCertificates stores a certificate for multiple domains +// DomainsCertificates stores a certificate for multiple domains. type DomainsCertificates struct { Certs []*DomainsCertificate } -// ChallengeCert stores a challenge certificate +// ChallengeCert stores a challenge certificate. type ChallengeCert struct { Certificate []byte PrivateKey []byte } -// DomainsCertificate contains a certificate for multiple domains +// DomainsCertificate contains a certificate for multiple domains. type DomainsCertificate struct { Domains v1.Domain Certificate *CertificateOld diff --git a/dumper/v1/storeddata.go b/dumper/v1/storeddata.go index 75525a4..b23579d 100644 --- a/dumper/v1/storeddata.go +++ b/dumper/v1/storeddata.go @@ -5,7 +5,7 @@ import ( "github.com/go-acme/lego/v3/registration" ) -// StoredData represents the data managed by the Store +// StoredData represents the data managed by the Store. type StoredData struct { Account *Account Certificates []*Certificate @@ -13,20 +13,20 @@ type StoredData struct { TLSChallenges map[string]*Certificate } -// Certificate is a struct which contains all data needed from an ACME certificate +// Certificate is a struct which contains all data needed from an ACME certificate. type Certificate struct { Domain Domain Certificate []byte Key []byte } -// Domain holds a domain name with SANs +// Domain holds a domain name with SANs. type Domain struct { Main string SANs []string } -// Account is used to store lets encrypt registration info +// Account is used to store lets encrypt registration info. type Account struct { Email string Registration *registration.Resource