Skip to content

Commit 73f514c

Browse files
committed
chore(builder): change interface{} to any
1 parent d0b654a commit 73f514c

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

pkg/conf/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const (
2323
var ServiceKeyLocation = "/var/run/secrets/drycc/controller/service-key"
2424

2525
// Parameters is map which contains storage params
26-
type Parameters map[string]interface{}
26+
type Parameters map[string]any
2727

2828
// GetServiceKey returns the key to be used as token to interact with drycc-controller
2929
func GetServiceKey() (string, error) {
@@ -37,7 +37,7 @@ func GetServiceKey() (string, error) {
3737

3838
// GetStorageParams returns the credentials required for connecting to object storage
3939
func GetStorageParams(env sys.Env) (Parameters, error) {
40-
params := make(map[string]interface{})
40+
params := make(map[string]any)
4141

4242
mEndpoint := env.Get(storageEndpointEnvVar)
4343
params["regionendpoint"] = mEndpoint

pkg/gitreceive/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ func buildBuilderPodNodeSelector(config string) (map[string]string, error) {
291291
return selector, nil
292292
}
293293

294-
func prettyPrintJSON(data interface{}) (string, error) {
294+
func prettyPrintJSON(data any) (string, error) {
295295
output := &bytes.Buffer{}
296296
if err := json.NewEncoder(output).Encode(data); err != nil {
297297
return "", err

pkg/gitreceive/k8s_util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ func progress(msg string, interval time.Duration) chan bool {
256256
return quit
257257
}
258258

259-
func createAppEnvConfigSecret(secretsClient typedcorev1.SecretInterface, secretName string, env map[string]interface{}) error {
259+
func createAppEnvConfigSecret(secretsClient typedcorev1.SecretInterface, secretName string, env map[string]any) error {
260260
newSecret := new(corev1.Secret)
261261
newSecret.Name = secretName
262262
newSecret.Type = corev1.SecretTypeOpaque

pkg/sshd/lock_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ func TestMultipleSameRepoLocks(t *testing.T) {
4343
func TestSingleLock(t *testing.T) {
4444
rl := NewInMemoryRepositoryLock(0)
4545
key := "fakeid"
46-
callbackCh := make(chan interface{})
46+
callbackCh := make(chan any)
4747
go lockAndCallback(rl, key, callbackCh)
4848
verifyCallbackHappens(t, callbackCh)
4949
}
5050

5151
func TestSingleLockUnlock(t *testing.T) {
5252
rl := NewInMemoryRepositoryLock(0)
5353
key := "fakeid"
54-
callbackCh := make(chan interface{})
54+
callbackCh := make(chan any)
5555
go lockAndCallback(rl, key, callbackCh)
5656
verifyCallbackHappens(t, callbackCh)
5757
err := rl.Unlock(key)
@@ -72,8 +72,8 @@ func TestInvalidUnlock(t *testing.T) {
7272
func TestDoubleLockUnlock(t *testing.T) {
7373
rl := NewInMemoryRepositoryLock(0)
7474
key := "fakeid"
75-
callbackCh1stLock := make(chan interface{})
76-
callbackCh2ndLock := make(chan interface{})
75+
callbackCh1stLock := make(chan any)
76+
callbackCh2ndLock := make(chan any)
7777

7878
go lockAndCallback(rl, key, callbackCh1stLock)
7979
verifyCallbackHappens(t, callbackCh1stLock)
@@ -108,13 +108,13 @@ func TestWrapInLock(t *testing.T) {
108108
}), nil)
109109
}
110110

111-
func lockAndCallback(rl RepositoryLock, id string, callbackCh chan<- interface{}) {
111+
func lockAndCallback(rl RepositoryLock, id string, callbackCh chan<- any) {
112112
if err := rl.Lock(id); err == nil {
113113
callbackCh <- true
114114
}
115115
}
116116

117-
func verifyCallbackHappens(t *testing.T, callbackCh <-chan interface{}) bool {
117+
func verifyCallbackHappens(t *testing.T, callbackCh <-chan any) bool {
118118
select {
119119
case <-callbackCh:
120120
return true
@@ -124,7 +124,7 @@ func verifyCallbackHappens(t *testing.T, callbackCh <-chan interface{}) bool {
124124
}
125125
}
126126

127-
func verifyCallbackDoesntHappens(t *testing.T, callbackCh <-chan interface{}) bool {
127+
func verifyCallbackDoesntHappens(t *testing.T, callbackCh <-chan any) bool {
128128
select {
129129
case <-callbackCh:
130130
t.Fatalf("Unexpected callback.")

0 commit comments

Comments
 (0)