()
| 17 | ) |
| 18 | |
| 19 | func initCache() { |
| 20 | excpath, _ := os.Executable() |
| 21 | cacheDir = filepath.Join(filepath.Dir(excpath), cacheDir) |
| 22 | if err := os.MkdirAll(cacheDir, 0777); err != nil { |
| 23 | logs.Error(err) |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | func Save(path string, reader io.Reader) bool { |
| 28 | os.MkdirAll(filepath.Dir(path), 0777) |