Replace "LS_COLORS" literals with a constant

This commit is contained in:
Kurtis Rader 2020-08-14 22:06:40 -07:00 committed by Qi Xiao
parent b9d515dd78
commit e04c503431
2 changed files with 7 additions and 6 deletions

View File

@ -50,7 +50,7 @@ func GetColorist() Colorist {
}
func getLsColors() string {
lsColorString := os.Getenv("LS_COLORS")
lsColorString := os.Getenv(util.EnvLS_COLORS)
if len(lsColorString) == 0 {
return defaultLsColorString
}

View File

@ -6,9 +6,10 @@ package util
// Note that some of these env vars may be significant only in special
// circumstances; such as when running unit tests.
const (
EnvHOME = "HOME"
EnvPATH = "PATH"
EnvPATHEXT = "PATHEXT"
EnvPWD = "PWD"
EnvSHLVL = "SHLVL"
EnvHOME = "HOME"
EnvPATH = "PATH"
EnvPATHEXT = "PATHEXT"
EnvPWD = "PWD"
EnvSHLVL = "SHLVL"
EnvLS_COLORS = "LS_COLORS"
)