mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-23 17:20:24 +08:00
rename (#98)
* 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 * rename Co-authored-by: kingxt <dream4kingxt@163.com>
This commit is contained in:
parent
a5ce2c448e
commit
8d0f7dbb27
@ -75,12 +75,12 @@ func MatchStruct(api string) (*ApiStruct, error) {
|
|||||||
var parseInfo = false
|
var parseInfo = false
|
||||||
var parseImport = false
|
var parseImport = false
|
||||||
var parseType = false
|
var parseType = false
|
||||||
var parseSevice = false
|
var parseService = false
|
||||||
var segment string
|
var segment string
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
line := strings.TrimSpace(scanner.Text())
|
line := strings.TrimSpace(scanner.Text())
|
||||||
|
|
||||||
if line == "@doc(" {
|
if line == "info(" {
|
||||||
parseInfo = true
|
parseInfo = true
|
||||||
}
|
}
|
||||||
if line == ")" && parseInfo {
|
if line == ")" && parseInfo {
|
||||||
@ -111,12 +111,12 @@ func MatchStruct(api string) (*ApiStruct, error) {
|
|||||||
segment = line + "\n"
|
segment = line + "\n"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
parseSevice = true
|
parseService = true
|
||||||
}
|
}
|
||||||
segment += scanner.Text() + "\n"
|
segment += scanner.Text() + "\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
if !parseSevice {
|
if !parseService {
|
||||||
return nil, errors.New("no service defined")
|
return nil, errors.New("no service defined")
|
||||||
}
|
}
|
||||||
result.Service = segment
|
result.Service = segment
|
||||||
|
Loading…
Reference in New Issue
Block a user