Your playground example was still not runnable. I have fixed it so it runs: https://go.dev/play/p/I57OftEerLY Now that we have a working example, what precisely is the problem you are having? On Saturday, June 4, 2022 at 2:56:43 PM UTC-4 Little Ant wrote:
> 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/c45e5942-1b52-4ef7-a1e2-2f079fc41f01n%40googlegroups.com.