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
|
// variables EDITOR and VISUAL
|
||||||
func GetEditor() string {
|
func GetEditor() string {
|
||||||
var editor string
|
var editor string
|
||||||
if os.Getenv("EDITOR") != "" {
|
if v, ok := os.LookupEnv("EDITOR"); ok {
|
||||||
editor = os.Getenv("EDITOR")
|
editor = v
|
||||||
} else if os.Getenv("VISUAL") != "" {
|
} else if v, ok := os.LookupEnv("VISUAL"); ok {
|
||||||
editor = os.Getenv("VISUAL")
|
editor = v
|
||||||
} /* else {
|
} /* else {
|
||||||
// TODO: maybe pick something based on the OS
|
// TODO: maybe pick something based on the OS
|
||||||
} */
|
} */
|
||||||
|
|
Loading…
Reference in a new issue