fix: fix(gctl): apiparser_parser auto format (#1607)

master
Fyn 3 years ago committed by GitHub
parent 6a66dde0a1
commit 0c35f39a7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -634,6 +634,3 @@ func NewSyntaxLitContext(parser antlr.Parser, parent antlr.ParserRuleContext, in
return p return p
} }

@ -8,6 +8,7 @@ import (
"bufio" "bufio"
"bytes" "bytes"
"fmt" "fmt"
"go/format"
"io/ioutil" "io/ioutil"
"log" "log"
"os" "os"
@ -61,7 +62,12 @@ import "github.com/zeromicro/antlr"
} }
} }
err = ioutil.WriteFile(fp, buffer.Bytes(), os.ModePerm) src, err := format.Source(buffer.Bytes())
if err != nil {
fmt.Printf("%+v\n", err)
break
}
err = ioutil.WriteFile(fp, src, os.ModePerm)
if err != nil { if err != nil {
fmt.Printf("%+v\n", err) fmt.Printf("%+v\n", err)
} }

Loading…
Cancel
Save