I am trying to manually create an instance of the type ReactionAddedEvent given here, in nlopes' Go Slack library. However, the sub-type reactionItem is unexported, which leads me to receive the error ./bot_test.go:111: cannot refer to unexported name slack.reactionItem
when trying to instantiate the object.
Here is my code:
m := &slack.ReactionAddedEvent{
Item: &slack.reactionItem{
File: &slack.File{
Preview: "Test",
URLPrivate: "http://google.com",
},
},
Reaction: "white_check_mark",
}
When I remove the identifier &slack.reactionItem
from line 2 in that snippet, I get instead the error: ./bot_test.go:112: missing type in composite literal
, obviously.
Is there any way for me to instantiate an object of this type with the parameters I need?