dont print filename if its reading from stdin

This commit is contained in:
Megan Marsh 2021-01-20 11:30:50 -08:00
parent 40df74e95a
commit 2b0996daa6
1 changed files with 4 additions and 2 deletions

View File

@ -117,8 +117,10 @@ func (f *HCL2Formatter) processFile(filename string) ([]byte, error) {
return nil, nil
}
s := []byte(fmt.Sprintf("%s\n", filename))
_, _ = f.Output.Write(s)
if filename != "-" {
s := []byte(fmt.Sprintf("%s\n", filename))
_, _ = f.Output.Write(s)
}
if f.Write {
if filename == "-" {