Good practices

This commit is contained in:
webb 2020-09-03 18:21:12 -04:00
parent 9d297fe792
commit 996e1ebb01
No known key found for this signature in database
GPG Key ID: 8B6F0D2784D22DB2
1 changed files with 7 additions and 7 deletions

14
cfg.go
View File

@ -6,15 +6,15 @@ import (
)
func getUploadKey() (string, error) {
PXL_KEY := os.Getenv("PXL_KEY")
if PXL_KEY != "" {
return PXL_KEY, nil
readKey := os.Getenv("PXL_KEY")
if readKey != "" {
return readKey, nil
}
MIRAGE_KEY := os.Getenv("MIRAGE_KEY")
if MIRAGE_KEY != "" {
return MIRAGE_KEY, nil
readKey = os.Getenv("MIRAGE_KEY")
if readKey != "" {
return readKey, nil
}
return "", errors.New("Upload key not set as environment variable!")
return "", errors.New("upload key not set as environment variable")
}