use os.LookupEnv like a regular human being
This commit is contained in:
parent
349fe9ef3d
commit
89006797fa
8
pkg/env/env.go
vendored
8
pkg/env/env.go
vendored
|
@ -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
|
||||
} */
|
||||
|
|
Loading…
Reference in a new issue