Go: add context (#17314)

### Summary

As title.

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-07-24 16:47:12 +08:00
committed by GitHub
parent 008fa3e10e
commit bdfc3ada41
78 changed files with 1031 additions and 904 deletions

View File

@@ -216,7 +216,7 @@ func (s *FileCommitService) CreateCommit(folderID, authorID, message string, cha
if err != nil {
return fmt.Errorf("failed to marshal tree state: %w", err)
}
if err := tx.Model(&entity.FileCommit{}).Where("id = ?", commitID).Update("tree_state", string(treeJSON)).Error; err != nil {
if err = tx.Model(&entity.FileCommit{}).Where("id = ?", commitID).Update("tree_state", string(treeJSON)).Error; err != nil {
return fmt.Errorf("failed to update tree state: %w", err)
}
treeStr = string(treeJSON)