Sync and Async requests support added by using go keyword.
This commit is contained in:
20
export.go
Normal file
20
export.go
Normal file
@ -0,0 +1,20 @@
|
||||
package gezer
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
func Export(response *Response) {
|
||||
file, err := os.Create("out.json")
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "output file creation error: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
for res := range response.Exports {
|
||||
//fmt.Println(res)
|
||||
_ = json.NewEncoder(file).Encode(res)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user