Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/storage/bucket_handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func (bh *bucketHandle) CreateAppendableObjectWriter(ctx context.Context,
}

if off != req.Offset {
err = fmt.Errorf("takeover offset for the created appendable object writer does not match the requested offset")
err = fmt.Errorf("takeover offset %v for the created appendable object writer does not match the requested offset %v", off, req.Offset)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better clarity and adherence to Go's idiomatic practices, it's recommended to use the %d format specifier for integer types instead of the general %v. This makes the expected type more explicit to readers of the code.

Suggested change
err = fmt.Errorf("takeover offset %v for the created appendable object writer does not match the requested offset %v", off, req.Offset)
err = fmt.Errorf("takeover offset %d for the created appendable object writer does not match the requested offset %d", off, req.Offset)

// Offset mismatch implies a stale object view. Return PreconditionError to trigger metadata cache eviction.
return nil, &gcs.PreconditionError{Err: err}
}
Expand Down
Loading