Based on https://github.com/adrg/xdg Licensed under MIT License (MIT) Copyright (c) 2014 Adrian-George Bostan
()
| 28 | // Copyright (c) 2014 Adrian-George Bostan <adrg@epistack.com> |
| 29 | |
| 30 | func osDependentCacheDir() (string, error) { |
| 31 | flags := []uint32{windows.KF_FLAG_DEFAULT, windows.KF_FLAG_DEFAULT_PATH} |
| 32 | for _, flag := range flags { |
| 33 | p, _ := windows.KnownFolderPath(windows.FOLDERID_LocalAppData, flag|windows.KF_FLAG_DONT_VERIFY) |
| 34 | if p != "" { |
| 35 | return filepath.Join(p, "cache", "docker-compose"), nil |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | appData, ok := os.LookupEnv("LOCALAPPDATA") |
| 40 | if ok { |
| 41 | return filepath.Join(appData, "cache", "docker-compose"), nil |
| 42 | } |
| 43 | |
| 44 | home, err := os.UserHomeDir() |
| 45 | if err != nil { |
| 46 | return "", err |
| 47 | } |
| 48 | return filepath.Join(home, "AppData", "Local", "cache", "docker-compose"), nil |
| 49 | } |
nothing calls this directly
no outgoing calls
no test coverage detected