apache / apache/rocketmq-client-go

[BUG] WriteToFile fails to create backup file before overwriting existing content

Open
#1,200 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.4k
Forks
445
PR merge metrics
No merged PRs in 30d

Description

**BUG REPORT**
1. Please describe the issue you observed:

- What did you do (The steps to reproduce)?
尝试向一个已存在的非空文件写入内容。

- What did you expect to see?
内容成功写入指定位置,原文件内容写入到备份文件中。

- What did you see instead?
备份文件内容为空

2. Please tell us about your environment:

3. Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):
应该是`err==nil` 时写入

![Image](https://github.com/user-attachments/assets/9b499bab-aa6e-4514-aa6c-93db0e43ccbe)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.