• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

yyle88 / syntaxgo / 18836268722

27 Oct 2025 07:06AM UTC coverage: 52.137% (-7.3%) from 59.469%
18836268722

push

github

yyle88
Remove deprecated AST merge functions and upgrade dependencies

  - Remove merge_package.go using deprecated ast.MergePackageFiles API
  - Clean up syntaxgo_ast package to use modern Go AST APIs
  - Upgrade Go version from 1.22.8 to 1.24.0

13 of 122 new or added lines in 8 files covered. (10.66%)

20 existing lines in 2 files now uncovered.

622 of 1193 relevant lines covered (52.14%)

7.46 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/internal/demos/demo2x/main.go
1
// Demo2x shows type reflection and package path extraction
2
// Extract package info from Go types using reflection
3
// Generate qualified type names for code generation
4
//
5
// Demo2x 展示类型反射和包路径提取
6
// 使用反射从 Go 类型提取包信息
7
// 生成用于代码生成的限定类型名
8
package main
9

10
import (
11
        "fmt"
12
        "reflect"
13

14
        "github.com/yyle88/syntaxgo/syntaxgo_reflect"
15
)
16

17
// MyStruct is an example struct with basic fields
18
// Used to show type reflection and path extraction
19
//
20
// MyStruct 是带有基本字段的示例结构体
21
// 用于展示类型反射和路径提取
22
type MyStruct struct {
23
        Name string // User name field // 用户名字段
24
        Age  int    // User age field // 用户年龄字段
25
}
26

NEW
27
func main() {
×
NEW
28
        // Extract package path from type instance
×
NEW
29
        // Package path is the import path where type is defined
×
NEW
30
        //
×
NEW
31
        // 从类型实例提取包路径
×
NEW
32
        // 包路径是定义类型的导入路径
×
NEW
33
        pkgPath := syntaxgo_reflect.GetPkgPath(MyStruct{})
×
NEW
34
        fmt.Println("Package path:", pkgPath)
×
NEW
35

×
NEW
36
        // Generate qualified type usage code
×
NEW
37
        // Format: packageName.TypeName for use in code generation
×
NEW
38
        //
×
NEW
39
        // 生成限定的类型使用代码
×
NEW
40
        // 格式:packageName.TypeName 用于代码生成
×
NEW
41
        typeCode := syntaxgo_reflect.GenerateTypeUsageCode(reflect.TypeOf(MyStruct{}))
×
NEW
42
        fmt.Println("Type usage code:", typeCode)
×
NEW
43
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc