use os.LookupEnv like a regular human being

This commit is contained in:
Lilian Jónsdóttir 2024-05-29 13:05:36 -07:00
parent 349fe9ef3d
commit 89006797fa

8
pkg/env/env.go vendored
View file

@ -13,10 +13,10 @@ import (
// variables EDITOR and VISUAL
func GetEditor() string {
var editor string
if os.Getenv("EDITOR") != "" {
editor = os.Getenv("EDITOR")
} else if os.Getenv("VISUAL") != "" {
editor = os.Getenv("VISUAL")
if v, ok := os.LookupEnv("EDITOR"); ok {
editor = v
} else if v, ok := os.LookupEnv("VISUAL"); ok {
editor = v
} /* else {
// TODO: maybe pick something based on the OS
} */