Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created December 12, 2018 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goofmint/38dbee3df07dc91bfd81e9c8e1ebefef to your computer and use it in GitHub Desktop.
Save goofmint/38dbee3df07dc91bfd81e9c8e1ebefef to your computer and use it in GitHub Desktop.
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