Tool to help you manage your Grafana dashboards using Git.

json.go 579B

12345678910111213141516
  1. package grafana
  2. // Taken from https://github.com/matrix-org/gomatrixserverlib/blob/7d789f4fb6fa1624901abf391426c5560d76793f/redactevent.go#L39-L51
  3. type rawJSON []byte
  4. // MarshalJSON implements the json.Marshaller interface using a value receiver.
  5. // This means that rawJSON used as an embedded value will still encode correctly.
  6. func (r rawJSON) MarshalJSON() ([]byte, error) {
  7. return []byte(r), nil
  8. }
  9. // UnmarshalJSON implements the json.Unmarshaller interface using a pointer receiver.
  10. func (r *rawJSON) UnmarshalJSON(data []byte) error {
  11. *r = rawJSON(data)
  12. return nil
  13. }