I have nearly solve the problem, except I have to use cast as
mod.(*Example1.AddModule) which is wrong.
How do you cast as mod.(*AddModule)?
On Saturday, 4 June 2022 at 11:40:15 UTC+8 Henry wrote:
> You need to cast the generic interface{} to its appropriate type. For
> instance:
>
> ```
>
I tried your solution and it still can't find .ModuleName(),
modules := vendorpackages.CompileModules()
for _, module := range modules {
mod, ok := module.(*AddModule)
if !ok {
//error handling if module is not of type AddModule
}
fmt.Println(mod.ModuleName()) //
To add on, the return value of mod is ""
fmt.Println(mod)
On Saturday, 4 June 2022 at 11:40:15 UTC+8 Henry wrote:
> You need to cast the generic interface{} to its appropriate type. For
> instance:
>
> ```
> modules := CompileModules()
> for _, module := range modules {
> mod, ok := modu
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:
>
>
> I
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:/
Hello,
Am Freitag, 3. Juni 2022 schrieb Harsh Rathore :
> Hello everyone,
> so I am trying to make a custom linux shell in golang, among other
things, I want this shell to be able to run BASH shell.
> Like when we are prompted with sh shell
> $
Of course it is feasable to make a Golang remake of
I have no idea what problem you are facing. Your example is not clear
enough to me. I think you may have several other problems in the mix as
well (such as calling code from another package, etc.). Try reading the
compiler error and see if it helps.
I have included a more elaborate example. Ho