Skip to content

Commit 3854d6d

Browse files
authored
fix array type generation error (#5142)
1 parent 8958549 commit 3854d6d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

tools/goctl/internal/version/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
)
77

88
// BuildVersion is the version of goctl.
9-
const BuildVersion = "1.9.0"
9+
const BuildVersion = "1.9.1-alpha"
1010

1111
var tag = map[string]int{"pre-alpha": 0, "alpha": 1, "pre-beta": 2, "beta": 3, "released": 4, "": 5}
1212

tools/goctl/pkg/parser/api/parser/analyzer.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,12 @@ func (a *Analyzer) getType(expr *ast.BodyStmt, req bool) (spec.Type, error) {
425425
}
426426
if body.LBrack != nil {
427427
if body.Star != nil {
428-
return spec.PointerType{
428+
return spec.ArrayType{
429429
RawName: rawText,
430-
Type: tp,
430+
Value: spec.PointerType{
431+
RawName: rawText,
432+
Type: tp,
433+
},
431434
}, nil
432435
}
433436
return spec.ArrayType{

0 commit comments

Comments
 (0)