Files
hamview/util.go
maze fb898bb058
Some checks failed
Run tests / test (1.25) (push) Has been cancelled
Run tests / test (stable) (push) Has been cancelled
Initial import
2026-02-22 20:27:07 +01:00

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)
}