Skip to content

Instantly share code, notes, and snippets.

@ishideo
Created June 24, 2019 10:42
Show Gist options
  • Save ishideo/b4ea85b18189ef553c45937316a26cb4 to your computer and use it in GitHub Desktop.
Save ishideo/b4ea85b18189ef553c45937316a26cb4 to your computer and use it in GitHub Desktop.
package main
import (
"encoding/json"
"fmt"
)
func main() {
body := map[string]interface{}{
"domain": "amazon.com",
"results": []string {"176.32.103.205", "205.251.242.103", "176.32.98.166"},
}
bytes, err := json.Marshal(body)
if err != nil {
fmt.Println("JSON marshal error: ", err)
return
}
fmt.Println(string(bytes))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment