fix: json marshaling

This commit is contained in:
yusing
2025-04-26 01:31:22 +08:00
parent db6fc65876
commit 03d609e4e1
8 changed files with 28 additions and 22 deletions

View File

@@ -2,6 +2,7 @@ package proxmox
import (
"context"
"encoding/json"
"fmt"
"strings"
@@ -38,11 +39,11 @@ func (n *Node) String() string {
return fmt.Sprintf("%s (%s)", n.name, n.id)
}
func (n *Node) MarshalMap() map[string]any {
return map[string]any{
func (n *Node) MarshalJSON() ([]byte, error) {
return json.Marshal(map[string]any{
"name": n.name,
"id": n.id,
}
})
}
func (n *Node) Get(ctx context.Context, path string, v any) error {