mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-10 16:30:01 +08:00
fix array type generation error (#5142)
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// BuildVersion is the version of goctl.
|
// BuildVersion is the version of goctl.
|
||||||
const BuildVersion = "1.9.0"
|
const BuildVersion = "1.9.1-alpha"
|
||||||
|
|
||||||
var tag = map[string]int{"pre-alpha": 0, "alpha": 1, "pre-beta": 2, "beta": 3, "released": 4, "": 5}
|
var tag = map[string]int{"pre-alpha": 0, "alpha": 1, "pre-beta": 2, "beta": 3, "released": 4, "": 5}
|
||||||
|
|
||||||
|
|||||||
@@ -425,9 +425,12 @@ func (a *Analyzer) getType(expr *ast.BodyStmt, req bool) (spec.Type, error) {
|
|||||||
}
|
}
|
||||||
if body.LBrack != nil {
|
if body.LBrack != nil {
|
||||||
if body.Star != nil {
|
if body.Star != nil {
|
||||||
return spec.PointerType{
|
return spec.ArrayType{
|
||||||
RawName: rawText,
|
RawName: rawText,
|
||||||
Type: tp,
|
Value: spec.PointerType{
|
||||||
|
RawName: rawText,
|
||||||
|
Type: tp,
|
||||||
|
},
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
return spec.ArrayType{
|
return spec.ArrayType{
|
||||||
|
|||||||
Reference in New Issue
Block a user