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
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
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