func parseTradeCmd(fullCmd string) *trade {
	f := func(r rune) bool {
		return !unicode.IsLetter(r) && !unicode.IsNumber(r) && !unicode.IsSpace(r)
	}
	bytes := bytes.FieldsFunc([]byte(fullCmd), f)
	var parsedCmd []string
	for _, e := range bytes {
		parsedCmd = append(parsedCmd, strings.ToLower(strings.TrimSpace(string(e))))
	}
	if len(parsedCmd) != 4 || !validTrade(parsedCmd) {
		// error - syntax not parsed correctly
		return nil
	}
	var t trade
	for i := 0; i < len(parsedCmd); i += 2 {
		if parsedCmd[i] == "item" {
			t.item = parsedCmd[i+1]
			continue
		}
		if parsedCmd[i] == "msg" {
			t.msg = parsedCmd[i+1]
			continue
		}
	}
	return &t
}
// parseTradeCmd will take a full command string and return a trade object
// if the command was correctly parsed
//
// else, nil
parseTradeCmd will take a full command string and return a trade object
if the command was correctly parsed

else, nil
// parseTradeCmd will take a full command string and return a trade object // if the command was correctly parsed // // else nil
func parseTradeCmd(fullCmd string) *trade {
	f := func(r rune) bool {
		return !unicode.IsLetter(r) && !unicode.IsNumber(r) && !unicode.IsSpace(r)
	}
	bytes := bytes.FieldsFunc([]byte(fullCmd), f)
	var parsedCmd []string
	for _, e := range bytes {
		parsedCmd = append(parsedCmd, strings.ToLower(strings.TrimSpace(string(e))))
	}
	if len(parsedCmd) != 4 || !validTrade(parsedCmd) {
		return nil
	}
	var t trade
	for i := 0; i < len(parsedCmd); i += 2 {
		if parsedCmd[i] == "item" {
			t.item = parsedCmd[i+1]
			continue
		}
		if parsedCmd[i] == "msg" {
			t.msg = parsedCmd[i+1]
			continue
		}
	}
	return &t
}
func parseTradeCmd ( fullCmd string ) * trade { f := func ( r rune ) bool { return ! unicode . IsLetter ( r ) && ! unicode . IsNumber ( r ) && ! unicode . IsSpace ( r ) } bytes := bytes . FieldsFunc ( [ ] byte ( fullCmd ) , f ) var parsedCmd [ ] string for _ , e := range bytes { parsedCmd = append ( parsedCmd , strings . ToLower ( strings . TrimSpace ( string ( e ) ) ) ) } if len ( parsedCmd ) != 4 || ! validTrade ( parsedCmd ) { return nil } var t trade for i := 0 ; i < len ( parsedCmd ) ; i += 2 { if parsedCmd [ i ] == " " { t . item = parsedCmd [ i + 1 ] continue } if parsedCmd [ i ] == " " { t . msg = parsedCmd [ i + 1 ] continue } } return & t }
parseTradeCmd will take a full command string and return a trade object
if the command was correctly parsed
parseTradeCmd will take a full command string and return a trade object if the command was correctly parsed
// error - syntax not parsed correctly