Chore: Fix tests (#4440)

This commit is contained in:
风扇滑翔翼 2025-02-25 21:11:37 +08:00 committed by GitHub
parent ce2384cccc
commit d451078e72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 7 deletions

View file

@ -50,17 +50,17 @@ func executeTypedMessageToJson(cmd *base.Command, args []string) {
reader, err := confloader.LoadConfig(cmd.Flag.Arg(0))
if err != nil {
base.Fatalf(err.Error())
base.Fatalf("failed to load config: %s", err)
}
b, err := io.ReadAll(reader)
if err != nil {
base.Fatalf(err.Error())
base.Fatalf("failed to read config: %s", err)
}
tm := cserial.TypedMessage{}
if err = json.Unmarshal(b, &tm); err != nil {
base.Fatalf(err.Error())
base.Fatalf("failed to unmarshal config: %s", err)
}
if j, ok := creflect.MarshalToJson(&tm, injectTypeInfo); ok {