mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 05:01:46 +00:00
Remove unused YAML tags and GetYAML/SetYAML methods
Unneeded after move to ghodss/yaml.
This commit is contained in:
@@ -79,35 +79,3 @@ func (t Time) MarshalJSON() ([]byte, error) {
|
||||
|
||||
return json.Marshal(t.Format(time.RFC3339))
|
||||
}
|
||||
|
||||
// SetYAML implements the yaml.Setter interface.
|
||||
func (t *Time) SetYAML(tag string, value interface{}) bool {
|
||||
if value == nil {
|
||||
t.Time = time.Time{}
|
||||
return true
|
||||
}
|
||||
|
||||
str, ok := value.(string)
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
|
||||
pt, err := time.Parse(time.RFC3339, str)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
t.Time = pt
|
||||
return true
|
||||
}
|
||||
|
||||
// GetYAML implements the yaml.Getter interface.
|
||||
func (t Time) GetYAML() (tag string, value interface{}) {
|
||||
if t.IsZero() {
|
||||
value = "null"
|
||||
return
|
||||
}
|
||||
|
||||
value = t.Format(time.RFC3339)
|
||||
return tag, value
|
||||
}
|
||||
|
Reference in New Issue
Block a user