mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-09-06 17:16:44 +00:00
![Radek Simko](/assets/img/avatar_default.png)
* vendor: Ignore github.com/hashicorp/terraform/backend This is to avoid dependency sprawl - e.g. vendoring AWS or Azure SDK when we don't really need remote backend functionality in provider code - it's core's responsibility. * vendor: github.com/hashicorp/terraform/...@v0.10.0
24 lines
467 B
Go
24 lines
467 B
Go
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
|
|
}
|