From a513d5766fbc4b57a8494990ab61f4ee8a265b3f Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 1 Apr 2024 18:36:25 +0000 Subject: [PATCH] fix: correct lint issues --- internal/api/api_test.go | 2 -- internal/authenticator/builder_internal_test.go | 2 -- internal/authenticator/manual_authenticator_test.go | 1 - internal/topics/config.go | 6 +++--- internal/topics/manager_test.go | 1 - internal/topics/topic.go | 6 +++--- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/internal/api/api_test.go b/internal/api/api_test.go index c4cc70fc..f5d895c6 100644 --- a/internal/api/api_test.go +++ b/internal/api/api_test.go @@ -98,8 +98,6 @@ func TestExtractVendorToken(t *testing.T) { }, } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/internal/authenticator/builder_internal_test.go b/internal/authenticator/builder_internal_test.go index c86840e3..35f7f66a 100644 --- a/internal/authenticator/builder_internal_test.go +++ b/internal/authenticator/builder_internal_test.go @@ -64,8 +64,6 @@ func TestToUserAccessType(t *testing.T) { } for _, c := range cases { - c := c - t.Run(c.name, func(t *testing.T) { t.Parallel() diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 67ca0ed5..dee45a00 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -417,7 +417,6 @@ func TestManualAuthenticator_validateAccessType(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/internal/topics/config.go b/internal/topics/config.go index 341e8901..148422f4 100644 --- a/internal/topics/config.go +++ b/internal/topics/config.go @@ -1,7 +1,7 @@ package topics type HashData struct { - Length int `koanf:"length"` - Salt string `koanf:"salt"` - Alphabet string `koanf:"alphabet"` + Length int `json:"length,omitempty" koanf:"length"` + Salt string `json:"salt,omitempty" koanf:"salt"` + Alphabet string `json:"alphabet,omitempty" koanf:"alphabet"` } diff --git a/internal/topics/manager_test.go b/internal/topics/manager_test.go index 4314fe5f..8ef7313e 100644 --- a/internal/topics/manager_test.go +++ b/internal/topics/manager_test.go @@ -141,7 +141,6 @@ func TestTopicManager(t *testing.T) { sub := "DXKgaNQa7N5Y7bo" for _, tc := range tests { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() diff --git a/internal/topics/topic.go b/internal/topics/topic.go index 136ff263..9ad8ffed 100644 --- a/internal/topics/topic.go +++ b/internal/topics/topic.go @@ -8,9 +8,9 @@ import ( ) type Topic struct { - Type string `koanf:"type"` - Template string `koanf:"template"` - Accesses map[string]acl.AccessType `koanf:"accesses"` + Type string `json:"type,omitempty" koanf:"type"` + Template string `json:"template,omitempty" koanf:"template"` + Accesses map[string]acl.AccessType `json:"accesses,omitempty" koanf:"accesses"` } type Template struct {