Skip to content

Instantly share code, notes, and snippets.

View wdenton's full-sized avatar

William Denton wdenton

View GitHub Profile
func postUrls(urls chan string) {
for url := range urls {
n := NewUrl{url}
data, _ := json.Marshal(n)
post:
resp, err := http.Post(*ginger, "application/json", bytes.NewReader(data))
if err != nil {
log.Fatal("post error: ", err)
} else if resp.StatusCode == http.StatusCreated {
log.Println("added ", url)