func formatSampleEvent()

in scripts/generate-docs/sample_event.go [41:53]


func formatSampleEvent(body []byte) ([]byte, error) {
	var d map[string]interface{}
	err := json.Unmarshal(body, &d)
	if err != nil {
		return nil, errors.Wrap(err, "unmarshaling sample event file failed")
	}

	body, err = json.MarshalIndent(d, "", "  ")
	if err != nil {
		return nil, errors.Wrap(err, "marshaling sample event file failed")
	}
	return body, nil
}