Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How can I update map fileds. #588

Unanswered
v1xingyue asked this question in General
Discussion options

I have some map fields in a Env , and a string content . Env struct is like this :

type Env struct {
 msg string
 fileds map[string]any
}

Now I want to add filed by the msg content , such as .

fileds["len"] = len(msgs)
fileds["uppper"] = uppper(msgs)

At last return the fields to the expr script caller.

How can I do that.

Thanks.

And I wonder why not provide built in much more map functions.

You must be logged in to vote

Replies: 1 comment

Comment options

I didn’t get the question. Expr doesn’t support assignment operations. You can add them as functions.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Converted from issue

This discussion was converted from issue #587 on March 01, 2024 09:18.

AltStyle によって変換されたページ (->オリジナル) /