//file, err := os.Create(filepath.Join(cacheDir, "wallpaper"))
tsNano := strconv.FormatInt(time.Now().UnixNano()/1e6, 10)
file, err := os.Create(filepath.Join(cacheDir, "wallpaper"+tsNano))
If the wallpaper file is in use on MacOS, it cannot be overwritten again;
Add the time parameter to the temporary file wallpaper to solve this problem
//file, err := os.Create(filepath.Join(cacheDir, "wallpaper"))
tsNano := strconv.FormatInt(time.Now().UnixNano()/1e6, 10)
file, err := os.Create(filepath.Join(cacheDir, "wallpaper"+tsNano))
If the wallpaper file is in use on MacOS, it cannot be overwritten again;
Add the time parameter to the temporary file wallpaper to solve this problem