Please see the below code
import (
...
"context"
...
)
type myStruct struct {
ID string
Sig string
}
mySig := myStruct{
ID: "12345678",
Sig: "Secret_Signature_Token",
}
// Setting a Value associated with a Key in Context
_ := context.WithValue(ctx, "myKey", &mySig) -- 1
//Getting the same value
value, ok := ctx.Value("myKey").(*myStruct) -- 2
Now, my question is: what is the use/meaning of .(*myStruct)
in the above expression number 2
Could someone please explain the statement number 2 step by step.