velodrome/fetcher/conversion.go
func NewIssueEvent(gIssueEvent *github.IssueEvent, issueID int, repository string) (*sql.IssueEvent, error) {
	if gIssueEvent.ID == nil ||
		gIssueEvent.Event == nil ||
		gIssueEvent.CreatedAt == nil {
		return nil, fmt.Errorf("IssueEvent is missing mandatory field: %+v", gIssueEvent)
	}

	var label *string
	if gIssueEvent.Label != nil {
		label = gIssueEvent.Label.Name
	}
	var assignee *string
	if gIssueEvent.Assignee != nil {
		assignee = gIssueEvent.Assignee.Login
	}
	var actor *string
	if gIssueEvent.Actor != nil {
		actor = gIssueEvent.Actor.Login
	}

	return &sql.IssueEvent{
		ID:             itoa(*gIssueEvent.ID),
		Label:          label,
		Event:          *gIssueEvent.Event,
		EventCreatedAt: *gIssueEvent.CreatedAt,
		IssueID:        strconv.Itoa(issueID),
		Assignee:       assignee,
		Actor:          actor,
		Repository:     strings.ToLower(repository),
	}, nil
}
func NewIssueEvent(gIssueEvent *github.IssueEvent, issueID int, repository string) (*sql.IssueEvent, error) {
	if gIssueEvent.ID == nil ||
		gIssueEvent.Event == nil ||
		gIssueEvent.CreatedAt == nil {
		return nil, fmt.Errorf("IssueEvent is missing mandatory field: %+v", gIssueEvent)
	}

	var label *string
	if gIssueEvent.Label != nil {
		label = gIssueEvent.Label.Name
	}
	var assignee *string
	if gIssueEvent.Assignee != nil {
		assignee = gIssueEvent.Assignee.Login
	}
	var actor *string
	if gIssueEvent.Actor != nil {
		actor = gIssueEvent.Actor.Login
	}

	return &sql.IssueEvent{
		ID:             itoa(*gIssueEvent.ID),
		Label:          label,
		Event:          *gIssueEvent.Event,
		EventCreatedAt: *gIssueEvent.CreatedAt,
		IssueID:        strconv.Itoa(issueID),
		Assignee:       assignee,
		Actor:          actor,
		Repository:     strings.ToLower(repository),
	}, nil
}
// NewIssueEvent creates a new (orm) Issue from a github Issue