21 lines
462 B
Go
21 lines
462 B
Go
package hamview
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
"go.yaml.in/yaml/v3"
|
|
)
|
|
|
|
// Logger used by this package.
|
|
var Logger *logrus.Logger = logrus.New()
|
|
|
|
func unmarshalOne(node yaml.Node, value any) error {
|
|
Logger.Printf("node: %#+v", node)
|
|
Logger.Printf("content: %d", len(node.Content))
|
|
if len(node.Content) != 1 {
|
|
return fmt.Errorf("hamview: expected 1 configuration value, got %d", len(node.Content))
|
|
}
|
|
return node.Content[0].Decode(value)
|
|
}
|