Skip to content

Commit 99a2c43

Browse files
code style
1 parent 7d74b06 commit 99a2c43

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

pkg/util/util.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,17 @@ func NameFromMeta(meta metav1.ObjectMeta) spec.NamespacedName {
6767
Name: meta.Name,
6868
}
6969
}
70+
7071
type Hasher func(user spec.PgUser) string
7172
type Random func(n int) string
7273

7374
type Encryptor struct {
7475
encrypt Hasher
75-
random Random
76+
random Random
7677
}
7778

7879
func NewEncryptor(encryption string) *Encryptor {
79-
e := Encryptor{random:RandomPassword}
80+
e := Encryptor{random: RandomPassword}
8081
m := map[string]Hasher{
8182
"md5": e.PGUserPasswordMD5,
8283
"scram-sha-256": e.PGUserPasswordScramSHA256,

pkg/util/util_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import (
1212
)
1313

1414
var pgUsers = []struct {
15-
in spec.PgUser
16-
outmd5 string
15+
in spec.PgUser
16+
outmd5 string
1717
outscramsha256 string
1818
}{{spec.PgUser{
1919
Name: "test",
@@ -120,7 +120,7 @@ func TestPGUserPassword(t *testing.T) {
120120
t.Errorf("PgUserPassword expected: %q, got: %q", tt.outmd5, pwd)
121121
}
122122
e = NewEncryptor("scram-sha-256")
123-
e.random = func(n int) string {return "salt"}
123+
e.random = func(n int) string { return "salt" }
124124
pwd = e.PGUserPassword(tt.in)
125125
if pwd != tt.outscramsha256 {
126126
t.Errorf("PgUserPassword expected: %q, got: %q", tt.outscramsha256, pwd)

0 commit comments

Comments
 (0)