goadesign / goa

🌟 Goa: Elevate Go API development! 🚀 Streamlined design, automatic code generation, and seamless HTTP/gRPC support. ✨
https://goa.design
MIT License
5.62k stars 557 forks source link

Example generation failed in the latest version #3495

Closed zenbigjoe closed 5 months ago

zenbigjoe commented 5 months ago

Hi I get an error with the latest release during the example generation. failed to load template security_authfuncs: open templates/security_authfuncs.go.tpl: file does not exist I missing something or the template doesn't exist.

Goa version 3.15.1

danielmichaels commented 5 months ago

I've also hit this issue just today,

task: [example] goa example github.com/xx/server/design 
exit status 2
panic: failed to load template security_authfuncs: open templates/security_authfuncs.go.tpl: file does not exist

goroutine 1 [running]:
goa.design/goa/v3/codegen/service.readTemplate({0x9d1e64, 0x12})
        /home/danielmichaels/go/pkg/mod/goa.design/goa/v3@v3.15.1/codegen/service/templates.go:15 +0xf4
goa.design/goa/v3/codegen/service.exampleServiceFile({0xc00002b740, 0x26}, 0x9?, 0xc000237700, {0xc0003c2ff0, 0x9})
        /home/danielmichaels/go/pkg/mod/goa.design/goa/v3@v3.15.1/codegen/service/example_svc.go:92 +0x605
goa.design/goa/v3/codegen/service.ExampleServiceFiles({0xc00002b740, 0x26}, 0xe3b040)
        /home/danielmichaels/go/pkg/mod/goa.design/goa/v3@v3.15.1/codegen/service/example_svc.go:53 +0x2b5
goa.design/goa/v3/codegen/generator.Example({0xc00002b740, 0x26}, {0xc000283540?, 0x26?, 0xc000283540?})
        /home/danielmichaels/go/pkg/mod/goa.design/goa/v3@v3.15.1/codegen/generator/example.go:24 +0x9c
goa.design/goa/v3/codegen/generator.Generate({0x7fffe792e31b, 0x1}, {0x9a9d8a, 0x7})
        /home/danielmichaels/go/pkg/mod/goa.design/goa/v3@v3.15.1/codegen/generator/generate.go:81 +0x77d
main.main()
        /home/danielmichaels/Code/github/xxx/server/goa255681297/main.go:59 +0x35c

Both 3.15 versions hit this issue.

Downgrading to v3.14.6 I was able to re-generate the examples.

danielmichaels commented 5 months ago

Thank you for such a prompt response to this issue.

I can confirm that using v3.15.2 will generate the examples.

raphael commented 5 months ago

Thank you both, closing the issue.