Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Without space after && leading error #63

Closed
Ovi3 opened this issue Jul 15, 2021 · 4 comments
Closed

Without space after && leading error #63

Ovi3 opened this issue Jul 15, 2021 · 4 comments

Comments

@Ovi3
Copy link

Ovi3 commented Jul 15, 2021

package main

import (
	"fmt"
	"github.com/PaesslerAG/gval"
)

func main() {
	vars := map[string]interface{}{"name": true}

	value, err := gval.Evaluate("true&&name", vars)
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println(value)

	value, err = gval.Evaluate("true&& name", vars)
	if err != nil {
		fmt.Println(err)
	}

	fmt.Println(value)
}

runing result:

parsing error: true&&name	 - 1:8 unknown operator &&n
<nil>
true

My expected result is the first expression also working fine.

@Ovi3 Ovi3 changed the title Need a space after && Without space after && leading error Jul 15, 2021
@generikvault
Copy link
Collaborator

yes this is because of the operator in
this operator should probably be a function in v2

@Ovi3
Copy link
Author

Ovi3 commented Sep 28, 2021

My current workaround is replacing "&&" to " && ".

By the way, any plan with v2 ?

@generikvault
Copy link
Collaborator

Probably a version with generic in and output types next year. Depends on wether it works the way I envision it.

@Ovi3
Copy link
Author

Ovi3 commented Oct 7, 2021

Cool. Thanks for your reply.

@Ovi3 Ovi3 closed this as completed Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants