Skip to content

Commit 549e4fb

Browse files
committed
linting errors
1 parent 12e798f commit 549e4fb

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

coderd/runtimeconfig/config_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import (
1616
)
1717

1818
func TestUsage(t *testing.T) {
19+
t.Parallel()
20+
1921
t.Run("deployment value without runtimeconfig", func(t *testing.T) {
2022
t.Parallel()
2123

@@ -186,7 +188,9 @@ func TestConfig(t *testing.T) {
186188
}
187189

188190
func TestScoped(t *testing.T) {
189-
orgId := uuid.New()
191+
t.Parallel()
192+
193+
orgID := uuid.New()
190194

191195
ctx := testutil.Context(t, testutil.WaitShort)
192196

@@ -209,7 +213,7 @@ func TestScoped(t *testing.T) {
209213
require.Equal(t, host, val.Host)
210214
require.Equal(t, port, val.Port)
211215

212-
orgMgr := mgr.Scoped(orgId.String())
216+
orgMgr := mgr.Scoped(orgID.String())
213217
// Using the org scope, nothing will be returned.
214218
_, err = field.Resolve(ctx, orgMgr)
215219
require.ErrorIs(t, err, runtimeconfig.EntryNotFound)

coderd/runtimeconfig/manager.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ func NewNoopManager() *NoopManager {
1717
return &NoopManager{}
1818
}
1919

20-
func (n NoopManager) GetRuntimeSetting(context.Context, string) (string, error) {
20+
func (NoopManager) GetRuntimeSetting(context.Context, string) (string, error) {
2121
return "", EntryNotFound
2222
}
2323

24-
func (n NoopManager) UpsertRuntimeSetting(context.Context, string, string) error {
24+
func (NoopManager) UpsertRuntimeSetting(context.Context, string, string) error {
2525
return EntryNotFound
2626
}
2727

28-
func (n NoopManager) DeleteRuntimeSetting(context.Context, string) error {
28+
func (NoopManager) DeleteRuntimeSetting(context.Context, string) error {
2929
return EntryNotFound
3030
}
3131

@@ -62,7 +62,7 @@ func (m StoreManager) GetRuntimeSetting(ctx context.Context, key string) (string
6262
func (m StoreManager) UpsertRuntimeSetting(ctx context.Context, key, val string) error {
6363
err := m.Store.UpsertRuntimeConfig(ctx, database.UpsertRuntimeConfigParams{Key: m.namespacedKey(key), Value: val})
6464
if err != nil {
65-
return xerrors.Errorf("update %q: %w", err)
65+
return xerrors.Errorf("update %q: %w", key, err)
6666
}
6767
return nil
6868
}

coderd/runtimeconfig/util.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
package runtimeconfig
22

33
import (
4-
"fmt"
54
"reflect"
6-
7-
"github.com/google/uuid"
85
)
96

107
func create[T any]() T {
118
var zero T
9+
//nolint:forcetypeassert
1210
return reflect.New(reflect.TypeOf(zero).Elem()).Interface().(T)
1311
}
14-
15-
func orgKey(orgID uuid.UUID, key string) string {
16-
return fmt.Sprintf("%s:%s", orgID.String(), key)
17-
}

0 commit comments

Comments
 (0)