소스 검색

Support JSON marshalling of PrefixedRegistry.

Alec Thomas 9 년 전
부모
커밋
78329dab49
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  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)
+}