support return () syntax (#101)
* rebase upstream * rebase * trim no need line * trim no need line * trim no need line * update doc * remove update * remove no need * remove no need * goctl add jwt support * goctl add jwt support * goctl add jwt support * goctl support import * goctl support import * support return () * support return () * remove pwd for windows not support * revert * remove no need Co-authored-by: kingxt <dream4kingxt@163.com>
This commit is contained in:
@@ -95,11 +95,11 @@ func (p *serviceEntityParser) parseLine(line string, api *spec.ApiSpec, annos []
|
||||
method := fields[0]
|
||||
path := fields[1]
|
||||
req := fields[2]
|
||||
var returns string
|
||||
var resp string
|
||||
|
||||
if stringx.Contains(fields, returnsTag) {
|
||||
if fields[len(fields)-1] != returnsTag {
|
||||
returns = fields[len(fields)-1]
|
||||
resp = fields[len(fields)-1]
|
||||
} else {
|
||||
return defaultErr
|
||||
}
|
||||
@@ -113,7 +113,7 @@ func (p *serviceEntityParser) parseLine(line string, api *spec.ApiSpec, annos []
|
||||
Method: method,
|
||||
Path: path,
|
||||
RequestType: GetType(api, req),
|
||||
ResponseType: GetType(api, returns),
|
||||
ResponseType: GetType(api, resp),
|
||||
})
|
||||
|
||||
return nil
|
||||
|
||||
@@ -91,19 +91,13 @@ func Prepare(projectDir string, checkGrpcEnv bool) (*Project, error) {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
pwd, err := execx.Run("pwd", projectDir)
|
||||
pwd, err := filepath.Abs(projectDir)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
pwd = filepath.Clean(strings.TrimSpace(pwd))
|
||||
|
||||
if !strings.HasPrefix(pwd, src) {
|
||||
absPath, err := filepath.Abs(projectDir)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
name = filepath.Clean(filepath.Base(absPath))
|
||||
name = filepath.Clean(filepath.Base(pwd))
|
||||
path = projectDir
|
||||
pkg = name
|
||||
isInGoEnv = false
|
||||
|
||||
Reference in New Issue
Block a user