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

go 1.14 context.WithValue value is map type error #39909

Closed
kjcx opened this issue Jun 29, 2020 · 1 comment
Closed

go 1.14 context.WithValue value is map type error #39909

kjcx opened this issue Jun 29, 2020 · 1 comment

Comments

@kjcx
Copy link

@kjcx kjcx commented Jun 29, 2020

What version of Go are you using (go version)?

$ go version
1.14.4

Does this issue reproduce with the latest release?

yes 1.13 is right

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

What did you do?

What did you expect to see?

package main

import (
"context"
"fmt"
)

func main(){
var md = make(map[string]string)
md["test"] = "it a map"
ctx := context.WithValue(context.TODO(),"key",md)
fmt.Println(ctx)
}
context.TODO.WithValue(type string, val

context WithValue donot write map type

What did you see instead?

can write map

@davecheney
Copy link
Contributor

@davecheney davecheney commented Jun 29, 2020

Do you mean that when you printed the value of ctx it was missing some information?

@kjcx kjcx closed this Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.