aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-07-26 23:12:04 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-07-26 23:12:04 +0200
commite8346d7378a74d107c1646eebb6430891aad0553 (patch)
tree9750987cf07b9ae76de9ab7fa52df7b30590cde3
parentfd253710b5161822275ef3211d5e68b462d1a548 (diff)
kiss
-rw-r--r--file/file.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/file/file.go b/file/file.go
index c6fb266..3e68f06 100644
--- a/file/file.go
+++ b/file/file.go
@@ -53,8 +53,7 @@ func Decode(r io.Reader, u encoding.BinaryUnmarshaler) (string, []byte, error) {
if !strings.HasPrefix(comment, untrusted) {
return "", nil, ErrComment
}
- comment = strings.TrimPrefix(comment, untrusted)
- comment = strings.TrimSpace(comment)
+ comment = strings.TrimSpace(comment[len(untrusted):])
raw, err := buf.ReadString('\n')
if err != nil {