Pretty print json

This commit is contained in:
grumbulon 2022-06-22 01:12:24 -04:00
parent 5096ab97fe
commit d80c4850bb
2 changed files with 4 additions and 3 deletions

2
awl.go
View File

@ -216,7 +216,7 @@ func main() {
}
if c.Bool("json") {
json, _ := json.Marshal(in)
json, _ := json.MarshalIndent(in, "", " ")
fmt.Println(string(json))
} else {
if !c.Bool("short") {

View File

@ -18,12 +18,13 @@ type Response struct {
Answers Answers `json:"Response"` //
}
// The basic structure of a DNS request
// The Answers struct is the basic structure of a DNS request
// to be returned to the user upon making a request
type Answers struct {
Server string `json:"Server"` // The server to make the DNS request from
Request uint16 `json:"Request"` // The type of request
Name string `json:"Name"` // The domain name to make a DNS request for
RTT time.Duration `json:"RTT"` // Time duration Answer
RTT time.Duration `json:"RTT"` // When AWL was ran
}
func ReverseDNS(dom string, q string) (string, error) {