mirror of
https://github.com/aykhans/sarin.git
synced 2026-10-16 14:43:53 +00:00
fix(config): reject a hidden YAML document and drop Go types from errors
This commit is contained in:
3 files changed
+184
-27
No files matched your search
@@ -33,7 +33,7 @@ func (size *byteSize) Set(value string) error {
|
||||
// UnmarshalYAML reads the raw scalar so a size parses the same way here as on the command line.
|
||||
func (size *byteSize) UnmarshalYAML(node *yaml.Node) error {
|
||||
if node.Kind != yaml.ScalarNode {
|
||||
return fmt.Errorf("expected a size, but got %s", node.Tag)
|
||||
return fmt.Errorf("expected a size, but got %s", yamlNodeName(node))
|
||||
}
|
||||
|
||||
return size.Set(node.Value)
|
||||
|
||||
Reference in new issue
Block a user