Thank you Jake, I have not have a complete working solution, but I have included comments to understand the feature I'm trying to build to add or remove my custom modules similar to written CMS that add and remove modules/plugins. Unsure if I should go by "receiver" way or method way.
https://go.dev/play/p/38sL3P-BSDr On Sunday, June 5, 2022 at 12:04:54 AM UTC+8 jake...@gmail.com wrote: > I find your example code confusing, and it *appears* to have multiple > syntax errors, which make it impossible to compile. If you could post a > complete "working" example to the playground you would probably get a > better response. > > On Thursday, June 2, 2022 at 8:17:04 AM UTC-4 Jay wrote: > >> >> >> In a code example, I’m confuse if it’s possible to call ModuleName() each >> package API after execute CompileModules()? >> >> >> app.go >> >> >> func CompileModules() []interface{ >> >> return []interface{ >> >> Example1.AddModule(), >> >> Example2.AddModule(), >> >> Example3.AddModule(), >> >> } >> >> } >> >> >> >> >> Init.go in Hello1 folder: >> >> package Example1 >> >> >> type AddModule struct {} >> >> >> func (p *AddModule) ModuleName() string { >> >> return “Hello 1” >> >> } >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/17da5bcc-aa6b-4543-8443-759b2aaca361n%40googlegroups.com.