rc: add support for Go 1.6

This commit is contained in:
remusb
2018-03-14 21:48:01 +02:00
committed by Remus Bunduc
parent 86e5a35491
commit 97b48cf988
4 changed files with 40 additions and 16 deletions

15
fs/rc/rc_new.go Normal file
View File

@ -0,0 +1,15 @@
//+build go1.7
package rc
import (
"encoding/json"
"io"
)
// WriteJSON writes JSON in out to w
func WriteJSON(w io.Writer, out Params) error {
enc := json.NewEncoder(w)
enc.SetIndent("", "\t")
return enc.Encode(out)
}