Sync and Async requests support added by using go keyword.

This commit is contained in:
Musab Gültekin
2019-06-07 21:31:18 +03:00
parent ee7d498f22
commit 9e61a96412
3 changed files with 69 additions and 43 deletions

20
export.go Normal file
View 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)
}
}