util.EncodeJSON proven harmful, remove it everywhere

People were misusing EncodeJSON in tests when they should be using
runtime.EncodeOrDie(testapi.Codec(), obj).  Removing the potential
for cutting self on sharp objects.
This commit is contained in:
Clayton Coleman
2014-11-13 10:38:13 -05:00
parent d4108ec47e
commit 6d31c2bf8a
7 changed files with 49 additions and 81 deletions

View File

@@ -60,12 +60,6 @@ func Forever(f func(), period time.Duration) {
}
}
// EncodeJSON returns obj marshalled as a JSON string, ignoring any errors.
func EncodeJSON(obj interface{}) string {
data, _ := json.Marshal(obj)
return string(data)
}
// IntOrString is a type that can hold an int or a string. When used in
// JSON or YAML marshalling and unmarshalling, it produces or consumes the
// inner type. This allows you to have, for example, a JSON field that can