13 lines
231 B
Go
13 lines
231 B
Go
package testing
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"k8s.io/apimachinery/pkg/util/yaml"
|
|
)
|
|
|
|
func StringToObject(data string, obj interface{}) error {
|
|
reader := strings.NewReader(data)
|
|
return yaml.NewYAMLOrJSONDecoder(reader, 10).Decode(obj)
|
|
}
|