July 2019
Intermediate to advanced
458 pages
12h 12m
English
The current limitation of our pseudo-terminal is its extensibility. If a new command needs to be added, it needs to be added directly into the main package. We can think of a way of separating the commands from the main package and allowing other users to extend the functionality with their commands:
// Command represents a terminal commandtype Command interface { GetName() string GetHelp() string Run(input io.Reader, output io.Writer, args ...string) (exit bool)}
// ErrDuplicateCommand is ...
Read now
Unlock full access