A
A
Artem Kislenko2017-09-18 13:11:44
go
Artem Kislenko, 2017-09-18 13:11:44

Where to put configs in Golang?

I am writing an application that uses the json config.
There are many folders (modules) in the application. Each module must name access to this config file.
As I understand it, after compilation, all paths will break if you work, for example, through
_, filename, _, _ := runtime.Caller(1)
How to be, where are the configs put in general, so that it would be good to test and run without problems?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikita, 2017-09-18
@webwork

$HOME/.appname

T
Trotilla, 2017-09-18
@Trotilla

If you are normal, then you have exactly 2 levels.
Root and first nesting level.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question