Skip to content

Commit a79996b

Browse files
reformat var names
1 parent 956a7bd commit a79996b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

main.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,14 @@ func readKeySecret() (string, string) {
191191
key := os.Getenv("LIVEKIT_KEY")
192192
secret := os.Getenv("LIVEKIT_SECRET")
193193
// We initialize potential key & secret path from environment variables
194-
key_path := os.Getenv("LIVEKIT_KEY_FROM_FILE")
195-
secret_path := os.Getenv("LIVEKIT_SECRET_FROM_FILE")
196-
key_secret_path := os.Getenv("LIVEKIT_KEY_FILE")
194+
keyPath := os.Getenv("LIVEKIT_KEY_FROM_FILE")
195+
secretPath := os.Getenv("LIVEKIT_SECRET_FROM_FILE")
196+
keySecretPath := os.Getenv("LIVEKIT_KEY_FILE")
197197

198-
// If key_secret_path is set we read the file and split it into two parts
198+
// If keySecretPath is set we read the file and split it into two parts
199199
// It takes over any other initialization
200-
if key_secret_path != "" {
201-
if keySecretBytes, err := os.ReadFile(key_secret_path); err != nil {
200+
if keySecretPath != "" {
201+
if keySecretBytes, err := os.ReadFile(keySecretPath); err != nil {
202202
log.Fatal(err)
203203
} else {
204204
key_secrets := strings.Split(string(keySecretBytes), ":")
@@ -209,18 +209,18 @@ func readKeySecret() (string, string) {
209209
secret = key_secrets[1]
210210
}
211211
} else {
212-
// If key_secret_path, we try to read the key and secret from files
212+
// If keySecretPath is not set, we try to read the key and secret from files
213213
// If those files are not set, we return the key & secret from the environment variables
214-
if key_path != "" {
215-
if keyBytes, err := os.ReadFile(key_path); err != nil {
214+
if keyPath != "" {
215+
if keyBytes, err := os.ReadFile(keyPath); err != nil {
216216
log.Fatal(err)
217217
} else {
218218
key = string(keyBytes)
219219
}
220220
}
221221

222-
if secret_path != "" {
223-
if secretBytes, err := os.ReadFile(secret_path); err != nil {
222+
if secretPath != "" {
223+
if secretBytes, err := os.ReadFile(secretPath); err != nil {
224224
log.Fatal(err)
225225
} else {
226226
secret = string(secretBytes)

0 commit comments

Comments
 (0)