Skip to content

Commit

Permalink
gg支持泛型
Browse files Browse the repository at this point in the history
  • Loading branch information
shenghui0779 committed Jan 16, 2025
1 parent 1190aaf commit 169b3fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/gg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func buildStruct(info *types.Info, ts *ast.TypeSpec, st *ast.StructType, gt []Ge
// 字段类型
fieldType := info.TypeOf(field.Type).String()
underlyingType := info.TypeOf(field.Type).Underlying().String()
fmt.Println(field.Names, "[fieldType]", fieldType, "[underlyingType]", underlyingType)
// fmt.Println(field.Names, "[fieldType]", fieldType, "[underlyingType]", underlyingType)
if dotIndex := strings.LastIndex(fieldType, "."); dotIndex >= 0 {
if pkg := fieldType[:dotIndex]; !filepath.IsAbs(pkg) {
imports = append(imports, pkg)
Expand Down

0 comments on commit 169b3fd

Please sign in to comment.