func updateIssueTrackerState(i messages.Issue, c messages.Config, to string) { i.Status = to msg := messages.UpdateIssue{ Issue: &i, Config: c, Status: to, } nc, _ := nats.Connect(nats.DefaultURL) nc.Publish("issues.update", ToJSON(msg)) }