elimisteve/go.github — pull request #1 by phayes (2014-02-21 19:17:55+00:00)
Title: Making ChPayloads exported

I'm trying to do somehing like the following (adding another handler to the web-service for some other purposes):

```go
package main

import (
"fmt"
"github.com/elimisteve/go.github/webhooks"
"net/http"
"os"
)

func webListener(port string, payloads chan *webhooks.GitHubPayload) {
webhooks.chPayloads = payloads
http.HandleFunc("/postreceive", webhooks.WebhookHandler)
http.HandleFunc("/anotherPath", handler)
if err := http.ListenAndServe(":"+port, nil); err != nil {
fmt.Printf("Error in webListener ListenAndServe: %v\n", err)
os.Exit(1)
}
}

func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[2:])
}

func main() {
payloads := make(chan *webhooks.GitHubPayload)
go webListener("8888", payloads)

for {
payload := <-payloads
fmt.Printf("Unmarshal'd callback data:\n%+v\n\n", payload)
}
}
```

However, I'm running into the problem that this is impossible unless chPayloads is exported. This pull request makes chPayloads exported to allow for this kind of use.