//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) }