Use bytes.NewReader instead of strings.NewReader in PostReview #11
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
PostReviewdoesstrings.NewReader(string(data))which copies[]byte→string→io.Reader. Extra allocation.Fix
Use
bytes.NewReader(data)directly. Small optimization but correct.