(origin string)
| 196 | } |
| 197 | |
| 198 | destPath := s.credentialsPath() |
| 199 | if err := os.Rename(tmpPath, destPath); err != nil { //nolint:gosec // G703: paths constructed internally |
| 200 | if runtime.GOOS == "windows" { |
| 201 | _ = os.Remove(destPath) |
| 202 | return os.Rename(tmpPath, destPath) //nolint:gosec // G703: same |
| 203 | } |
| 204 | _ = os.Remove(tmpPath) //nolint:gosec // G703: path from os.CreateTemp |
| 205 | return err |
| 206 | } |
| 207 | return nil |
| 208 | } |
| 209 |
no test coverage detected