Commit d1348b98 authored by Vladimir Zorin's avatar Vladimir Zorin

Trim whitespaces before checking if line is empty or comment

parent 567532d7
......@@ -254,8 +254,9 @@ func checksum(bytes []byte) string {
func isEmptyYaml(yaml []byte) bool {
isEmpty := true
lines := bytes.Split(yaml, []byte("\n"))
for _, k := range lines {
if string(k) != "---" && !bytes.HasPrefix(k, []byte("#")) && string(k) != "" {
for _, l := range lines {
s := bytes.TrimSpace(l)
if string(s) != "---" && !bytes.HasPrefix(s, []byte("#")) && string(s) != "" {
isEmpty = false
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment