Files
dygou_go/internal/config/shared_proxy_config_replace_windows.go
T

19 lines
348 B
Go

//go:build windows
package config
import (
"errors"
"os"
)
func replaceSharedProxyConfigFile(tempPath, targetPath string) error {
if err := os.Rename(tempPath, targetPath); err == nil {
return nil
}
if err := os.Remove(targetPath); err != nil && !errors.Is(err, os.ErrNotExist) {
return err
}
return os.Rename(tempPath, targetPath)
}