ReadJSON reads JSON fixture to the struct at the destination address
(path string, destination interface{})
| 110 | |
| 111 | // ReadJSON reads JSON fixture to the struct at the destination address |
| 112 | func ReadJSON(path string, destination interface{}) { |
| 113 | var dat []byte |
| 114 | dat, err := os.ReadFile(path) |
| 115 | if err != nil { |
| 116 | panic(errors.Wrap(err, "Failed to load fixture payload")) |
| 117 | } |
| 118 | if err := json.Unmarshal(dat, destination); err != nil { |
| 119 | panic(errors.Wrap(err, "Failed to get event")) |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | // NewDnoteCmd returns a new Dnote command and a pointer to stderr |
| 124 | func NewDnoteCmd(opts RunDnoteCmdOptions, binaryName string, arg ...string) (*exec.Cmd, *bytes.Buffer, *bytes.Buffer, error) { |
no outgoing calls