func uint32ToGo(term *ast.Terminal) (uint32, error) { if term.Uint32Value == nil { return 0, &ErrWrongType{"uint32", term.String()} } return term.GetUint32Value(), nil }
func doubleToGo(term *ast.Terminal) (float64, error) { if term.DoubleValue == nil { return 0, &ErrWrongType{"double", term.String()} } return term.GetDoubleValue(), nil }
func bytesToGo(term *ast.Terminal) ([]byte, error) { if term.BytesValue == nil { return nil, &ErrWrongType{"[]byte", term.String()} } return term.GetBytesValue(), nil }
func stringToGo(term *ast.Terminal) (string, error) { if term.StringValue == nil { return "", &ErrWrongType{"string", term.String()} } return term.GetStringValue(), nil }
func boolToGo(term *ast.Terminal) (bool, error) { if term.BoolValue == nil { return false, &ErrWrongType{"bool", term.String()} } return term.GetBoolValue(), nil }
func int64ToGo(term *ast.Terminal) (int64, error) { if term.Int64Value == nil { return 0, &ErrWrongType{"int64", term.String()} } return term.GetInt64Value(), nil }
func floatToGo(term *ast.Terminal) (float32, error) { if term.FloatValue == nil { return 0, &ErrWrongType{"float", term.String()} } return term.GetFloatValue(), nil }