# When you can't find a conf file by your Golang code

That happens because Go search for a config file at the root of your project.
This solution works if the file is in some other directory.


```go
workingdir, err := os.Getwd()
if err != nil {
    log.Fatalf("can't get pwd: %s", err)
}
```
and then
```
viper.AddConfigPath(workingdir + "/")
viper.SetConfigName("app")
viper.SetConfigType("env")
```
or just
```
viper.SetConfigFile(workingdir + "/app.env")
```
