Summary
In samples/tokens/issuer/main.go, the error returned by os.Getwd() is silently discarded using _. If the call
fails, cwd will be an empty string and the program will continue with an invalid working directory path, causing
confusing downstream failures with no indication of the root cause.
Location
samples/tokens/issuer/main.go, line 32
Current Code
cwd, _ := os.Getwd()
Problem
- os.Getwd() can fail if the working directory has been deleted, a parent directory has had its permissions
revoked, or a mounted filesystem has been unmounted.
- When it fails, cwd becomes "" (empty string).
- This empty string is passed directly to common.StartFSC(*pth, path.Join(*pth, "data")), causing the FSC node to
start with a wrong/missing config path.
- The program fails later with a misleading error, not at the point where it could have exited cleanly.
Summary
In samples/tokens/issuer/main.go, the error returned by os.Getwd() is silently discarded using _. If the call
fails, cwd will be an empty string and the program will continue with an invalid working directory path, causing
confusing downstream failures with no indication of the root cause.
Location
samples/tokens/issuer/main.go, line 32
Current Code
cwd, _ := os.Getwd()
Problem
revoked, or a mounted filesystem has been unmounted.
start with a wrong/missing config path.