[go-nuts] custom linux shell that can run bash shell

2022-06-03 Thread 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 $ executing /bin/bash, provides bash prompt $ /bin/bash user@hostName:~# similarly, I want my golang shell to provide

[go-nuts] Re: Functions vs Methods: explain reasoning behind STD

2022-06-03 Thread Henry
I think after a while people tend to come up with their own best practices when using Go. Each person has their own preference. There is really no right or wrong here. The argument for method vs function usually comes down to the domain and which makes more sense. For my own 'rules', I prefer

[go-nuts] Re: How to call function from struct in slice?

2022-06-03 Thread Henry
You need to cast the generic interface{} to its appropriate type. For instance: ``` modules := CompileModules() for _, module := range modules { mod, ok := module.(*AddModule) if !ok { //error handling if module is not of type AddModule } fmt.Println(mod.Module