optimized goctl format (#336)

* fix format

* refactor

* refactor

* optimized

* refactor

* refactor

* refactor

* add js path prefix
This commit is contained in:
kingxt
2021-01-04 18:59:48 +08:00
committed by GitHub
parent 01060cf16d
commit 12e235efb0
6 changed files with 138 additions and 40 deletions

View File

@@ -24,11 +24,11 @@ handler: GreetHandler
}
`
formattedStr = `type Request struct {
formattedStr = `type Request {
Name string
}
type Response struct {
type Response {
Message string
}
@@ -40,7 +40,7 @@ service A-api {
}`
)
func TestInlineTypeNotExist(t *testing.T) {
func TestFormat(t *testing.T) {
r, err := apiFormat(notFormattedStr)
assert.Nil(t, err)
assert.Equal(t, r, formattedStr)