17 lines
240 B
Go
17 lines
240 B
Go
|
package main
|
||
|
|
||
|
import "strings"
|
||
|
|
||
|
type Command struct {
|
||
|
Name string
|
||
|
Arguments []string
|
||
|
}
|
||
|
|
||
|
func parseCommand(msg string) *Command {
|
||
|
split := strings.Split(msg, " ")
|
||
|
return &Command{
|
||
|
Name: split[0],
|
||
|
Arguments: split[1:],
|
||
|
}
|
||
|
}
|