In recent go versions, the following crossplatform functions to obtain user-specific directories are available in the os
package:
func UserCacheDir() (string, error) (added in go1.11)
func UserHomeDir() (string, error) (added in go1.12)
func UserConfigDir() (string, error) (added in go1.13)
OP wants