We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to get more information on this? I dont fully understand the syntax or the concepts behind it,
here is where im at,
package main import ( "context" "fmt" "io" "github.com/Merith-TK/gosh/api" ) type customCmd string func (t customCmd) Name() string { return string(t) } func (t customCmd) Usage() string { return `custom` } func (t customCmd) ShortDesc() string { return `prints greeting "custom there"` } func (t customCmd) LongDesc() string { return t.ShortDesc() } func (t customCmd) Exec(ctx context.Context, args []string) (context.Context, error) { out := ctx.Value("gosh.stdout").(io.Writer) fmt.Fprintln(out, "custom there") return ctx, nil } // command module type customCmds struct{} func (t *customCmds) Init(ctx context.Context) error { out := ctx.Value("gosh.stdout").(io.Writer) fmt.Fprintln(out, "custom module loaded OK") return nil } func (t *customCmds) Registry() map[string]api.Command { return map[string]api.Command{ "custom": customCmd("custom"), } } // Commands just custom var Commands customCmds
This is a modifcation of testcmd.go I understand everything up to line 17,
i dont understand how to declare and call upon functions entirely for this plugin in a easy to understand method,
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is it possible to get more information on this? I dont fully understand the syntax or the concepts behind it,
here is where im at,
This is a modifcation of testcmd.go
I understand everything up to line 17,
i dont understand how to declare and call upon functions entirely for this plugin in a easy to understand method,
The text was updated successfully, but these errors were encountered: