mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-09-06 09:06: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
31 lines
556 B
Go
31 lines
556 B
Go
package semver
|
|
|
|
import (
|
|
"database/sql/driver"
|
|
"fmt"
|
|
)
|
|
|
|
// Scan implements the database/sql.Scanner interface.
|
|
func (v *Version) Scan(src interface{}) (err error) {
|
|
var str string
|
|
switch src := src.(type) {
|
|
case string:
|
|
str = src
|
|
case []byte:
|
|
str = string(src)
|
|
default:
|
|
return fmt.Errorf("Version.Scan: cannot convert %T to string.", src)
|
|
}
|
|
|
|
if t, err := Parse(str); err == nil {
|
|
*v = t
|
|
}
|
|
|
|
return
|
|
}
|
|
|
|
// Value implements the database/sql/driver.Valuer interface.
|
|
func (v Version) Value() (driver.Value, error) {
|
|
return v.String(), nil
|
|
}
|