Skip to content

Instantly share code, notes, and snippets.

@affix
Created January 22, 2020 21:02
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 affix/2f4d68eb7f307cbe1641791a393e464d to your computer and use it in GitHub Desktop.
Save affix/2f4d68eb7f307cbe1641791a393e464d to your computer and use it in GitHub Desktop.
XML to JSON in Go Marshal to JSON
func Handle(req []byte) string {
json, _ := json.Marshal(data.Channel.Posts) // Encode our Struct as JSON
return fmt.Sprintf("%s", string(json)) // Return a String to the OpenFaaS Gateway
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment