Skip to content

Commit 7a47d74

Browse files
committed
Ignore trailing spaces when verifying format #13
1 parent 9856b93 commit 7a47d74

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/cfn-format/main.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55
"io/ioutil"
66
"os"
7+
"strings"
78

89
"github.com/aws-cloudformation/rain/cfn"
910
"github.com/aws-cloudformation/rain/cfn/format"
@@ -99,7 +100,7 @@ func main() {
99100
if len(fileName) > 0 {
100101
fmt.Fprint(os.Stderr, fileName+": ")
101102
}
102-
if string(input) == output {
103+
if strings.TrimSpace(string(input)) == output {
103104
fmt.Fprintln(os.Stderr, "formatted OK")
104105
os.Exit(0)
105106
} else {

0 commit comments

Comments
 (0)