From 0a1bc1208fd1afb0a94e302b919eff163c184d49 Mon Sep 17 00:00:00 2001 From: Ivan Valdes Date: Thu, 28 Mar 2024 23:24:55 -0700 Subject: [PATCH] server/embed: address golangci var-naming issues Addresses issues in TLSMinVersion, TLSMaxVersion, WALDir, and MaxWALFiles. Signed-off-by: Ivan Valdes --- server/embed/config.go | 11 ++++++++--- server/embed/util.go | 8 ++++---- server/etcdmain/config_test.go | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/server/embed/config.go b/server/embed/config.go index b440f0c333b..ef9c27a6dd6 100644 --- a/server/embed/config.go +++ b/server/embed/config.go @@ -149,8 +149,9 @@ func init() { // Config holds the arguments for configuring an etcd server. type Config struct { - Name string `json:"name"` - Dir string `json:"data-dir"` + Name string `json:"name"` + Dir string `json:"data-dir"` + //revive:disable-next-line:var-naming WalDir string `json:"wal-dir"` SnapshotCount uint64 `json:"snapshot-count"` @@ -163,7 +164,8 @@ type Config struct { SnapshotCatchUpEntries uint64 `json:"experimental-snapshot-catch-up-entries"` MaxSnapFiles uint `json:"max-snapshots"` - MaxWalFiles uint `json:"max-wals"` + //revive:disable-next-line:var-naming + MaxWalFiles uint `json:"max-wals"` // TickMs is the number of milliseconds between heartbeat ticks. // TODO: decouple tickMs and heartbeat tick (current heartbeat tick = 1). @@ -231,8 +233,11 @@ type Config struct { CipherSuites []string `json:"cipher-suites"` // TlsMinVersion is the minimum accepted TLS version between client/server and peers. + //revive:disable-next-line:var-naming TlsMinVersion string `json:"tls-min-version"` + // TlsMaxVersion is the maximum accepted TLS version between client/server and peers. + //revive:disable-next-line:var-naming TlsMaxVersion string `json:"tls-max-version"` ClusterState string `json:"initial-cluster-state"` diff --git a/server/embed/util.go b/server/embed/util.go index 269fbc80b20..32efbe67a46 100644 --- a/server/embed/util.go +++ b/server/embed/util.go @@ -21,9 +21,9 @@ import ( ) func isMemberInitialized(cfg *Config) bool { - waldir := cfg.WalDir - if waldir == "" { - waldir = filepath.Join(cfg.Dir, "member", "wal") + walDir := cfg.WalDir + if walDir == "" { + walDir = filepath.Join(cfg.Dir, "member", "wal") } - return wal.Exist(waldir) + return wal.Exist(walDir) } diff --git a/server/etcdmain/config_test.go b/server/etcdmain/config_test.go index 8332a892a97..3cd32675bcf 100644 --- a/server/etcdmain/config_test.go +++ b/server/etcdmain/config_test.go @@ -57,7 +57,7 @@ func TestConfigFileMemberFields(t *testing.T) { yc := struct { Dir string `json:"data-dir"` MaxSnapFiles uint `json:"max-snapshots"` - MaxWalFiles uint `json:"max-wals"` + MaxWALFiles uint `json:"max-wals"` Name string `json:"name"` SnapshotCount uint64 `json:"snapshot-count"` SnapshotCatchUpEntries uint64 `json:"experimental-snapshot-catch-up-entries"`