func (s Side) FromString(str string) (err error) {
	switch strings.ToLower(str) {
	default:
		err = fmt.Errorf("Cannot get side from string, not buy or sell")
		return
	case buyString:
		s = Buy
	case sellString:
		s = Sell
	}
	return
}
FromString takes a string and, if valid, sets the Side to the
correct value based on the string
package match
import (
	"encoding/json"
	"fmt"
	"strings"
)
type Side bool
const (
	Buy        = Side(true)   
	Sell       = Side(false)  
	buyString  = "buy"        
	sellString = "sell"       
)
func (s Side) String() string {
	if s {
		return buyString
	}
	return sellString
}
func (s Side) UnmarshalJSON(b []byte) (err error) {
	var str string
	if err = json.Unmarshal(b, &str); err != nil {
		return
	}
	switch strings.ToLower(str) {
	default:
		err = fmt.Errorf("Cannot unmarshal side json, not buy or sell")
		return
	case buyString:
		s = Buy
	case sellString:
		s = Sell
	}
	return
}