go-github icon indicating copy to clipboard operation
go-github copied to clipboard

Add EventType consts representing the X-Github-Event header values

Open MaerF0x0 opened this issue 5 months ago • 4 comments

What: Adds type EventType string and an EventType const for every of the types in the maps in github/messages.go

Why: So that we can do switches like

switch eventType {
    case github.EventTypeFork:
        // do stuff
     case github.EventTypeDiscussionComment, github.EventTypeIssueComment:
        // do something with either
}

Notes:

  • It should be non-breaking change
  • Let me know if you want the EventType used more widely including implementing type EventTyper interface{} on each of those structs

MaerF0x0 avatar Sep 19 '24 05:09 MaerF0x0