From 03f9786902507bfccc122edf13e98fb89a40af71 Mon Sep 17 00:00:00 2001 From: jingchenguang <782070772@qq.com> Date: Wed, 7 Feb 2024 23:01:36 +0800 Subject: [PATCH] =?UTF-8?q?jvms.json=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6pr?= =?UTF-8?q?etty=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.go b/main.go index 56c28b7..91bb749 100644 --- a/main.go +++ b/main.go @@ -356,6 +356,14 @@ func getJdkVersions() ([]JdkVersion, error) { } func startup(c *cli.Context) error { + + store.Register( + "json", + func(v interface{}) ([]byte, error) { + return json.MarshalIndent(v, "", " ") + }, + json.Unmarshal) + store.Init("jvms") if err := store.Load("jvms.json", &config); err != nil { return errors.New("failed to load the config:" + err.Error())