Initial import
This commit is contained in:
20
util.go
Normal file
20
util.go
Normal file
@@ -0,0 +1,20 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user