I'm trying to understand a relative path building in Go. Here is my problem: I have a folders tree:
-root
--main
---utils
---certs
--tests
Having my certificates uploaded into certs folder and connectivity util.go file uploaded into utils, I have relative paths hard coded in the file.
Problem: Having paths specified in utils/util.go, they work fine once called from main/main.go and throw exception (file not found) when called from tests/test.go.
What's the way out?
path.Join()orfilepath.Join()to get the full path. I edited my answer to show an example of it.