1
0
Fork 0
mirror of https://github.com/gohugoio/hugo.git synced 2025-03-21 09:41:05 +00:00

parser: Use strings.Contains instead of strings.Index

Closes 
This commit is contained in:
bogem 2016-08-30 22:30:33 +05:00 committed by Bjørn Erik Pedersen
parent 798bf60c56
commit 4d1cb50003

View file

@ -181,7 +181,7 @@ func chompFrontmatterStartComment(r *bufio.Reader) (err error) {
return nil
}
testStr := strings.TrimSuffix(str[0:lineEnd], "\r")
if strings.Index(testStr, HTMLCommentEnd) != -1 {
if strings.Contains(testStr, HTMLCommentEnd) {
return nil
}
buf := make([]byte, lineEnd)
@ -208,7 +208,7 @@ func chompFrontmatterEndComment(r *bufio.Reader) (err error) {
return nil
}
testStr := strings.TrimSuffix(str[0:lineEnd], "\r")
if strings.Index(testStr, HTMLCommentStart) != -1 {
if strings.Contains(testStr, HTMLCommentStart) {
return nil
}