modify the bytereader to handler windows line ending.

This commit is contained in:
Jijie Wei
2020-07-07 00:22:06 -07:00
parent fd3a4a88be
commit 488a88ec6e
2 changed files with 35 additions and 1 deletions

View File

@@ -115,7 +115,9 @@ func (r *ByteReader) Read() ([]*yaml.RNode, error) {
if err != nil {
return nil, errors.Wrap(err)
}
values := strings.Split(input.String(), "\n---\n")
// replace the ending \r\n (line ending used in windows) with \n and then separate by \n---\n
values := strings.Split(strings.Replace(input.String(), "\r\n", "\n", -1), "\n---\n")
index := 0
for i := range values {