mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-05 19:21:37 +00:00
Remove unused YAML tags and GetYAML/SetYAML methods
Unneeded after move to ghodss/yaml.
This commit is contained in:
@@ -88,34 +88,6 @@ func NewIntOrStringFromString(val string) IntOrString {
|
||||
return IntOrString{Kind: IntstrString, StrVal: val}
|
||||
}
|
||||
|
||||
// SetYAML implements the yaml.Setter interface.
|
||||
func (intstr *IntOrString) SetYAML(tag string, value interface{}) bool {
|
||||
switch v := value.(type) {
|
||||
case int:
|
||||
intstr.Kind = IntstrInt
|
||||
intstr.IntVal = v
|
||||
return true
|
||||
case string:
|
||||
intstr.Kind = IntstrString
|
||||
intstr.StrVal = v
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// GetYAML implements the yaml.Getter interface.
|
||||
func (intstr IntOrString) GetYAML() (tag string, value interface{}) {
|
||||
switch intstr.Kind {
|
||||
case IntstrInt:
|
||||
value = intstr.IntVal
|
||||
case IntstrString:
|
||||
value = intstr.StrVal
|
||||
default:
|
||||
panic("impossible IntOrString.Kind")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaller interface.
|
||||
func (intstr *IntOrString) UnmarshalJSON(value []byte) error {
|
||||
if value[0] == '"' {
|
||||
|
Reference in New Issue
Block a user