trim newlines from uname
Jes Olson j3s@c3f.net
Sat, 01 Oct 2022 15:42:43 -0500
1 files changed,
4 insertions(+),
4 deletions(-)
jump to
M
env/env.go
→
env/env.go
@@ -98,25 +98,25 @@ out, err := exec.Command("uname", "-m").Output()
if err != nil { return uname, err } - uname.Arch = string(out) + uname.Arch = strings.TrimSuffix(string(out), "\n") out, err = exec.Command("uname", "-n").Output() if err != nil { return uname, err } - uname.Nodename = string(out) + uname.Nodename = strings.TrimSuffix(string(out), "\n") out, err = exec.Command("uname", "-r").Output() if err != nil { return uname, err } - uname.Release = string(out) + uname.Release = strings.TrimSuffix(string(out), "\n") out, err = exec.Command("uname", "-s").Output() if err != nil { return uname, err } - uname.Sysname = string(out) + uname.Sysname = strings.TrimSuffix(string(out), "\n") return uname, nil }