Skip to content

Commit

Permalink
Fix empty commit because of encode add a newline (#633)
Browse files Browse the repository at this point in the history
Co-authored-by: 杨赫然 <[email protected]>
  • Loading branch information
feiniks and 杨赫然 authored Oct 21, 2023
1 parent 7bb8866 commit cc42c87
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion fileserver/fsmgr/fsmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,16 @@ func jsonNoEscape(data interface{}) ([]byte, error) {
return nil, err
}

return buf.Bytes(), nil
bytes := buf.Bytes()

// Encode will terminate each value with a newline.
// This makes the output look a little nicer
// when debugging, and some kind of space
// is required if the encoded value was a number,
// so that the reader knows there aren't more
// digits coming.
// The newline at the end needs to be removed for the above reasons.
return bytes[:len(bytes)-1], nil
}

// SeafDir is a dir object
Expand Down

0 comments on commit cc42c87

Please sign in to comment.