add missing error contexts for getwd calls

This commit is contained in:
Gokcehan 2022-03-06 18:46:53 +03:00
parent 25476e79ef
commit 07b35def77

View File

@ -67,7 +67,7 @@ func exportEnvVars() {
dir, err := os.Getwd() dir, err := os.Getwd()
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "%s\n", err) fmt.Fprintf(os.Stderr, "getting current directory: %s\n", err)
} }
os.Setenv("OLDPWD", dir) os.Setenv("OLDPWD", dir)
@ -304,7 +304,7 @@ func main() {
case 0: case 0:
_, err := os.Getwd() _, err := os.Getwd()
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "%s\n", err) fmt.Fprintf(os.Stderr, "getting current directory: %s\n", err)
os.Exit(2) os.Exit(2)
} }
case 1: case 1: