prepared for the new jsonv2 mod

This commit is contained in:
2026-07-13 12:32:43 +02:00
parent c5a21bd677
commit 05ac8eb870

View File

@@ -17,6 +17,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package es package es
import ( import (
// "encoding/json/jsontext"
// "encoding/json/v2"
"encoding/json" "encoding/json"
"fmt" "fmt"
@@ -51,6 +54,15 @@ func getHealthReport(conf *cfg.Config) (*HealthReport, error) {
report := HealthReport{} report := HealthReport{}
// FIXME: use this once jsonv2 is no more experimental
//
// if err := json.UnmarshalDecode(
// jsontext.NewDecoder(
// bytes.NewBuffer(raw)),
// &report); err != nil {
// return nil, fmt.Errorf("failed to unmarshal healthreport response: %w", err)
// }
if err := json.Unmarshal(raw, &report); err != nil { if err := json.Unmarshal(raw, &report); err != nil {
return nil, fmt.Errorf("failed to unmarshal healthreport response: %w", err) return nil, fmt.Errorf("failed to unmarshal healthreport response: %w", err)
} }