mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 11:24:17 +02:00
prepared for the new jsonv2 mod
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user