Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1940ca0

Browse files
committed
linting errors
1 parent048506d commit1940ca0

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
funcTestUsage(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
funcTestScoped(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 (nNoopManager)GetRuntimeSetting(context.Context,string) (string,error) {
20+
func (NoopManager)GetRuntimeSetting(context.Context,string) (string,error) {
2121
return"",EntryNotFound
2222
}
2323

24-
func (nNoopManager)UpsertRuntimeSetting(context.Context,string,string)error {
24+
func (NoopManager)UpsertRuntimeSetting(context.Context,string,string)error {
2525
returnEntryNotFound
2626
}
2727

28-
func (nNoopManager)DeleteRuntimeSetting(context.Context,string)error {
28+
func (NoopManager)DeleteRuntimeSetting(context.Context,string)error {
2929
returnEntryNotFound
3030
}
3131

@@ -62,7 +62,7 @@ func (m StoreManager) GetRuntimeSetting(ctx context.Context, key string) (string
6262
func (mStoreManager)UpsertRuntimeSetting(ctx context.Context,key,valstring)error {
6363
err:=m.Store.UpsertRuntimeConfig(ctx, database.UpsertRuntimeConfigParams{Key:m.namespacedKey(key),Value:val})
6464
iferr!=nil {
65-
returnxerrors.Errorf("update %q: %w",err)
65+
returnxerrors.Errorf("update %q: %w",key,err)
6666
}
6767
returnnil
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
funccreate[Tany]()T {
118
varzeroT
9+
//nolint:forcetypeassert
1210
returnreflect.New(reflect.TypeOf(zero).Elem()).Interface().(T)
1311
}
14-
15-
funcorgKey(orgID uuid.UUID,keystring)string {
16-
returnfmt.Sprintf("%s:%s",orgID.String(),key)
17-
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp