From 89006797faee8f78f97bce2a6b42c20c1c4fc226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Wed, 29 May 2024 13:05:36 -0700 Subject: [PATCH] use os.LookupEnv like a regular human being --- pkg/env/env.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/env/env.go b/pkg/env/env.go index 300e76d..36e36be 100644 --- a/pkg/env/env.go +++ b/pkg/env/env.go @@ -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 } */