From 008ed531a225e08afa3b8687e0d4117ba91e9bf5 Mon Sep 17 00:00:00 2001 From: brent s Date: Sat, 18 Dec 2021 04:46:43 -0500 Subject: [PATCH] ...SplitN, not SplitAfterN --- envs/utils.go | 4 ++-- paths/funcs.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/envs/utils.go b/envs/utils.go index 59eef7c..b683878 100644 --- a/envs/utils.go +++ b/envs/utils.go @@ -16,8 +16,8 @@ func envListToMap(envs []string) (envMap map[string]string) { envMap = make(map[string]string, 0) for _, ev := range envs { - kv = strings.SplitAfterN(ev, "=", 2) - // I *think* SplitAfterN does this for me, but... + kv = strings.SplitN(ev, "=", 2) + // I *think* SplitN does this for me, but... if len(kv) == 1 { kv = append(kv, "") } diff --git a/paths/funcs.go b/paths/funcs.go index 3697782..0bf01e7 100644 --- a/paths/funcs.go +++ b/paths/funcs.go @@ -62,7 +62,7 @@ func ExpandHome(path *string) (err error) { } */ // K but do it smarter. - unameSplit = strings.SplitAfterN(*path, string(os.PathSeparator), 2) + unameSplit = strings.SplitN(*path, string(os.PathSeparator), 2) if len(unameSplit) != 2 { unameSplit = append(unameSplit, "") }