YReshetko / go-annotation

Library which provides a tool to build annotations and generate go code based on the annotations
MIT License
16 stars 1 forks source link

examples/mapper errors? #30

Open chenjpu opened 7 months ago

chenjpu commented 7 months ago
WARN: unable to find type "Primitives" by import: files for import "github.com/YReshetko/go-annotation/examples/mapper/internal/models/output" not found
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x5cd8b2]

goroutine 1 [running]:
github.com/YReshetko/go-annotation/annotations/mapper/generators/nodes.(*Field).DeclaredType(...)
        D:/opensource/annotation-labs/go-annotation/annotations/mapper/generators/nodes/field.go:33
github.com/YReshetko/go-annotation/annotations/mapper/generators.(*methodGenerator).generate(0xc000280090, {0xc0002a2000, 0x14})
        D:/opensource/annotation-labs/go-annotation/annotations/mapper/generators/method.go:64 +0xf2
github.com/YReshetko/go-annotation/annotations/mapper/generators.(*MapperGenerator).Generate(0xc000296060)
        D:/opensource/annotation-labs/go-annotation/annotations/mapper/generators/mapper.go:61 +0x133
github.com/YReshetko/go-annotation/annotations/mapper.(*Processor).Process(0xc0000550e0, {0x6aa4d8?, 0xc000064370})
        D:/opensource/annotation-labs/go-annotation/annotations/mapper/processor.go:75 +0x365
github.com/YReshetko/go-annotation/pkg.moduleNodeProcessor.func1.1.func2(...)
        D:/opensource/annotation-labs/go-annotation/pkg/process.go:129
github.com/YReshetko/go-annotation/internal/utils/stream.Stream[...].RangeErr(...)
        D:/opensource/annotation-labs/go-annotation/internal/utils/stream/stream.go:54
github.com/YReshetko/go-annotation/pkg.moduleNodeProcessor.func1.1({0x6a77c0?, 0xc00019e500}, {0xc00009e500, 0x4, 0x4})
        D:/opensource/annotation-labs/go-annotation/pkg/process.go:78 +0x4db
github.com/YReshetko/go-annotation/internal/ast.walk.func1({0x6a77c0?, 0xc00019e500?})
        D:/opensource/annotation-labs/go-annotation/internal/ast/walk.go:33 +0x433
go/ast.inspector.Visit(0xc0000940d8, {0x6a77c0?, 0xc00019e500?})
        C:/Users/hgc-dev/sdk/go1.20.13/src/go/ast/walk.go:386 +0x31
go/ast.Walk({0x6a6520?, 0xc0000940d8?}, {0x6a77c0?, 0xc00019e500?})
        C:/Users/hgc-dev/sdk/go1.20.13/src/go/ast/walk.go:51 +0x5f
go/ast.Walk({0x6a6520?, 0xc0000940d8?}, {0x6a7400?, 0xc00019e800?})
        C:/Users/hgc-dev/sdk/go1.20.13/src/go/ast/walk.go:344 +0x191c
go/ast.walkDeclList({0x6a6520, 0xc0000940d8}, {0xc0001ce000?, 0x10, 0x3ed47e?})
        C:/Users/hgc-dev/sdk/go1.20.13/src/go/ast/walk.go:38 +0x69
go/ast.Walk({0x6a6520?, 0xc0000940d8?}, {0x6a7338?, 0xc0001d6000?})
        C:/Users/hgc-dev/sdk/go1.20.13/src/go/ast/walk.go:366 +0x17ac
go/ast.Inspect(...)
        C:/Users/hgc-dev/sdk/go1.20.13/src/go/ast/walk.go:397
github.com/YReshetko/go-annotation/internal/ast.walk(0xc000048148?, 0xc00009e280)
        D:/opensource/annotation-labs/go-annotation/internal/ast/walk.go:9 +0xa5
github.com/YReshetko/go-annotation/internal/ast.Walk(...)
        D:/opensource/annotation-labs/go-annotation/internal/ast/interface.go:18
github.com/YReshetko/go-annotation/pkg.moduleNodeProcessor.func1({{0xc00009c180?, 0xc00002abc0?}, 0xc0001d6000?})
        D:/opensource/annotation-labs/go-annotation/pkg/process.go:64 +0x109
github.com/YReshetko/go-annotation/internal/utils/stream.Stream[...].RangeErr(...)
        D:/opensource/annotation-labs/go-annotation/internal/utils/stream/stream.go:54
github.com/YReshetko/go-annotation/pkg.run({0x6a6f50?, 0xc00002abc0?}, {0xc00011e900?, 0x60?, 0x0?})
        D:/opensource/annotation-labs/go-annotation/pkg/process.go:48 +0x148
github.com/YReshetko/go-annotation/pkg.Process()
        D:/opensource/annotation-labs/go-annotation/pkg/process.go:22 +0x5d
main.main()
        D:/opensource/annotation-labs/go-annotation/examples/mapper/cmd/main.go:9 +0x17
exit status 2
generate.go:1: running "go": exit status 1
chenjpu commented 7 months ago

window file PathSeparator is \, importPath PathSeparator is /