Created
June 24, 2019 10:42
-
-
Save ishideo/b4ea85b18189ef553c45937316a26cb4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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