Explorar el Código

Support JSON marshalling of PrefixedRegistry.

Alec Thomas hace 9 años
padre
commit
78329dab49
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      json.go

+ 4 - 0
json.go

@@ -81,3 +81,7 @@ func WriteJSON(r Registry, d time.Duration, w io.Writer) {
 func WriteJSONOnce(r Registry, w io.Writer) {
 	json.NewEncoder(w).Encode(r)
 }
+
+func (p *PrefixedRegistry) MarshalJSON() ([]byte, error) {
+	return json.Marshal(p.underlying)
+}