fix array type generation error (#5142)

This commit is contained in:
kesonan
2025-09-04 21:41:15 +08:00
committed by GitHub
parent 895854913a
commit 3854d6dd00
2 changed files with 6 additions and 3 deletions

View File

@@ -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}

View File

@@ -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{