I am running go test -v $(go list ./... | grep -v /vendor/)
to run all tests excluding vendor. My file structure is
myRepo
api
user_test.go
config
key.json
main.go
I have key.json file under config folder for maintianing all api keys. I am using filepath.Abs to load key.json file. Everything is working fine except when I run tests. When I run go tests the root path is changing to myRepo/api and the error I am getting is unable to find myRepo/api/config/key.json