cmd/sgblog-comment-add/main.go | 4 ++-- common.go | 2 +- diff --git a/cmd/sgblog-comment-add/main.go b/cmd/sgblog-comment-add/main.go index c3885b3bc77628d4897caac0ede4924593ef7439fce3a8a2063ea67cf027a13b..06972461ce00eccb465aa5a175b6ef80a72043d1c9aa4b074f8e638166041ef8 100644 --- a/cmd/sgblog-comment-add/main.go +++ b/cmd/sgblog-comment-add/main.go @@ -98,13 +98,13 @@ *gitCmd, "--git-dir", *gitDir, "notes", "--ref", *notesRef, "show", subj, ) note, _ := cmd.Output() - note = bytes.TrimSuffix(note, []byte{'\n'}) + note = bytes.TrimRight(note, "\r\n") // Remove trailing whitespaces, because git-notes-add will remove // them anyway, and we have to know exact bytes count lines := strings.Split(string(body), "\n") for i, line := range lines { - lines[i] = strings.TrimRight(line, " ") + lines[i] = strings.TrimRight(line, " \r") } for lines[len(lines)-1] == "" { lines = lines[:len(lines)-1] diff --git a/common.go b/common.go index 78c0b11773c64969b73f3f15d0805b49f7bbdbf58acc5c198e00b0af248fe415..40cfc5cf82299b5fc956e504717057b3e1e82d66388c484137d6ec1bc6580949 100644 --- a/common.go +++ b/common.go @@ -3,5 +3,5 @@ package sgblog const ( WhenFmt = "2006-01-02 15:04:05Z07:00" - Version = "0.3.0" + Version = "0.3.1" )