route support no request and response (#178)

* add more test and support no request and response

* fix slash when run on windows

* optimize test
This commit is contained in:
kingxt
2020-11-02 13:48:16 +08:00
committed by GitHub
parent 4c9315e984
commit b776468e69
4 changed files with 42 additions and 1 deletions

View File

@@ -70,6 +70,12 @@ func (p *serviceEntityParser) parseLine(line string, api *spec.ApiSpec, annos []
ch, _, err := reader.ReadRune()
if err != nil {
if err == io.EOF {
if builder.Len() > 0 {
token := strings.TrimSpace(builder.String())
if len(token) > 0 && token != returnsTag {
fields = append(fields, token)
}
}
break
}
return err