Use os.UserCacheDir()
and os.UserConfigDir()
instead.
Easily get cache and config folders for your app according to each OS spec
import "http://gopkg.in/caarlos0/gohome.v2"
const appName = "my-app"
func main() {
config := gohome.Config(appName) // gives you the right config folder for the current OS
cache := gohome.Cache(appName) // gives you the right cache folder for the current OS
// ...
}