published by bot

copied from https://github.com/kubernetes/kubernetes.git
last commit is df54a2836137e2fe637813c3b7872b91ab1b6009
This commit is contained in:
Kubernetes Publisher
2016-08-25 20:20:26 +00:00
parent b7b3ea5394
commit 294573fbea
301 changed files with 0 additions and 0 deletions

View File

@@ -1,23 +0,0 @@
package semver
import (
"encoding/json"
)
// MarshalJSON implements the encoding/json.Marshaler interface.
func (v Version) MarshalJSON() ([]byte, error) {
return json.Marshal(v.String())
}
// UnmarshalJSON implements the encoding/json.Unmarshaler interface.
func (v *Version) UnmarshalJSON(data []byte) (err error) {
var versionString string
if err = json.Unmarshal(data, &versionString); err != nil {
return
}
*v, err = Parse(versionString)
return
}