I am trying to pass custom JSON data from variable to initialize jwt.MapClaims object (type MapClaims map[string]interface{}).
The initialization works by directly passing keys and values:
jwt.MapClaims{
"key": "value",
"anotherKey": "anotherValue",
}
I have a function with argument named claimData of type map[string]interface{}
I've accomplished to pass the data and initialize MapClaims this way:
jwtClaims := jwt.MapClaims{}
for key, value := range claimData {
jwtClaims[key] = value
}
Is it possible to initialize it directly in 1 line without using any iteration?