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

Accessor character . is recognizaed as float. #172

Open
NJU-JYH opened this issue Mar 31, 2023 · 3 comments
Open

Accessor character . is recognizaed as float. #172

NJU-JYH opened this issue Mar 31, 2023 · 3 comments

Comments

@NJU-JYH
Copy link

NJU-JYH commented Mar 31, 2023

why when I write code like this:


u := User{FirstName: "go", LastName: "jack", Age: 18}
parameters := make(map[string]interface{})
parameters["u"] = u
expr, _ := govaluate.NewEvaluableExpression("u.FullName()")
result, _ := expr.Evaluate(parameters)
fmt.Println("user", result)

it will report error runtime error: invalid memory address or nil pointer dereference

The accessor character . is recognized as float ?

@WideLee
Copy link

WideLee commented Oct 25, 2023

fixed in master but not release, we can try this go get -u github.com/Knetic/govaluate@master

require (
	github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible
)

@alehatsman
Copy link

@WideLee thanks for the fix!

@atmnksd
Copy link

atmnksd commented May 24, 2024

@WideLee i don't see any commit in master since last 7 years :-)

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

4 participants