1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-10-20 06:54:17 +00:00

Fix empty commit because of encode add a newline (#633)

Co-authored-by: 杨赫然 <heran.yang@seafile.com>
This commit is contained in:
feiniks
2023-10-21 10:23:21 +08:00
committed by GitHub
parent 7bb8866889
commit cc42c87d71

View File

@@ -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