Print deprecation notice when using unprefixed env var
This commit is contained in:
parent
b1023cdcfd
commit
a2a5415ace
@ -2,6 +2,7 @@ package command
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/user"
|
"os/user"
|
||||||
"strings"
|
"strings"
|
||||||
@ -150,6 +151,9 @@ func getPrefixedEnvVar(name string) string {
|
|||||||
val := os.Getenv(envVarPrefix + name)
|
val := os.Getenv(envVarPrefix + name)
|
||||||
if val == "" {
|
if val == "" {
|
||||||
val = os.Getenv(name)
|
val = os.Getenv(name)
|
||||||
|
if val != "" {
|
||||||
|
fmt.Printf("[DEPRECATION] Usage of %s env var is deprecated, please use PGWEB_%s variable instead\n", name, name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return val
|
return val
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user