Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created December 12, 2018 01:45
Embed
What would you like to do?
go func() {
todo := document.Call("getElementById", "todo")
var value = todo.Get("value").String()
input, err := json.Marshal(Input{Todo: value})
res, err := http.Post(domain, "application/json", bytes.NewBuffer(input))
if err != nil {
log.Fatal(err)
} else {
addTodo(document, value)
}
defer res.Body.Close()
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment