fixing authorization
This commit is contained in:
33
parse
Normal file
33
parse
Normal file
@@ -0,0 +1,33 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"verint.com/focusedopps/internal/opps"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// open json file
|
||||
jsonFile, err := os.Open("example.json")
|
||||
// if os.Open returns an error then print out it
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
fmt.Println("Successfully Opened complex.json")
|
||||
// defer the closing of the json file
|
||||
defer jsonFile.Close()
|
||||
|
||||
byteValue, _ := ioutil.ReadAll(jsonFile)
|
||||
var result opps.Result
|
||||
err = json.Unmarshal(byteValue, &result)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Printf("Opportunities: %+v\n", result.Data.Opportunities)
|
||||
fmt.Printf("Next: %+v\n", result.Data.Next)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user