code: func InterfaceToValue(x interface{}) (Value, error) {
  	switch x := x.(type) {
  	case nil:
  		return Null{}, nil
  	case bool:
  		return Boolean(x), nil
  	case json.Number:
  		return Number(x), nil
  	case int64:
  		return int64Number(x), nil
  	case float64:
  		return floatNumber(x), nil
  	case int:
  		return intNumber(x), nil
  	case string:
  		return String(x), nil
  	case []interface{}:
  		r := Array{}
  		for _, e := range x {
  			e, err := InterfaceToValue(e)
  			if err != nil {
  				return nil, err
  			}
  			r = append(r, &Term{Value: e})
  		}
  		return r, nil
  	case map[string]interface{}:
  		r := NewObject()
  		for k, v := range x {
  			k, err := InterfaceToValue(k)
  			if err != nil {
  				return nil, err
  			}
  			v, err := InterfaceToValue(v)
  			if err != nil {
  				return nil, err
  			}
  			r.Insert(NewTerm(k), NewTerm(v))
  		}
  		return r, nil
  	case map[string]string:
  		r := NewObject()
  		for k, v := range x {
  			k, err := InterfaceToValue(k)
  			if err != nil {
  				return nil, err
  			}
  			v, err := InterfaceToValue(v)
  			if err != nil {
  				return nil, err
  			}
  			r.Insert(NewTerm(k), NewTerm(v))
  		}
  		return r, nil
  	default:
  		return nil, fmt.Errorf("ast: illegal value: %T", x)
  	}
  }
docs: // InterfaceToValue converts a native Go value x to a Value.