Skip to content

Commit c8b5358

Browse files
charles-dyfis-netaead
authored andcommitted
Add trailing newline on signature output
A minisign signature consists of lines of text. On Windows, text files are newline-delimited: newlines are needed only to separate lines, and a line can be valid without a newline after it (should it be the last line in a file). On UNIX, text files are newline-terminated: to be a fully legal text file, each line _including the last one_ is expected to have a trailing newline. The upstream C minisign tool follows UNIX conventions for signature output in this respect. With this PR, the golang tool does likewise.
1 parent 6214f2a commit c8b5358

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

signature.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ func (s Signature) String() string {
107107
buffer.WriteByte('\n')
108108

109109
buffer.WriteString(base64.StdEncoding.EncodeToString(s.CommentSignature[:]))
110+
buffer.WriteByte('\n')
111+
110112
return buffer.String()
111113
}
112114

0 commit comments

Comments
 (0)