blob: 6d7a4ca8c47dd3c65638b696c3af8035204ba3ca [file] [log] [blame]
Francisco Souza289a3572012-03-22 18:25:40 +11001// Copyright 2012 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package main
6
7import (
8 "encoding/json"
9 "log"
10 "os"
11)
12
13func main() {
14 dec := json.NewDecoder(os.Stdin)
15 enc := json.NewEncoder(os.Stdout)
16 for {
17 var v map[string]interface{}
18 if err := dec.Decode(&v); err != nil {
19 log.Println(err)
20 return
21 }
22 for k := range v {
23 if k != "Name" {
24 delete(v, k)
25 }
26 }
27 if err := enc.Encode(&v); err != nil {
28 log.Println(err)
29 }
30 }
31}