Replace `json.RawMessage` for list log messages (#177)
diff --git a/logging_query.go b/logging_query.go index a21e908..db41b74 100644 --- a/logging_query.go +++ b/logging_query.go
@@ -2,8 +2,6 @@ // SPDX-License-Identifier: MPL-2.0 package tfjson -import "encoding/json" - const ( MessageListStart LogMessageType = "list_start" MessageListResourceFound LogMessageType = "list_resource_found" @@ -17,9 +15,9 @@ } type ListStartData struct { - Address string `json:"address"` - ResourceType string `json:"resource_type"` - InputConfig map[string]json.RawMessage `json:"input_config,omitempty"` + Address string `json:"address"` + ResourceType string `json:"resource_type"` + InputConfig map[string]any `json:"input_config,omitempty"` } // ListResourceFoundMessage represents "query" result message of type "list_resource_found" @@ -29,14 +27,14 @@ } type ListResourceFoundData struct { - Address string `json:"address"` - DisplayName string `json:"display_name"` - Identity map[string]json.RawMessage `json:"identity"` - IdentityVersion int64 `json:"identity_version"` - ResourceType string `json:"resource_type"` - ResourceObject map[string]json.RawMessage `json:"resource_object,omitempty"` - Config string `json:"config,omitempty"` - ImportConfig string `json:"import_config,omitempty"` + Address string `json:"address"` + DisplayName string `json:"display_name"` + Identity map[string]any `json:"identity"` + IdentityVersion int64 `json:"identity_version"` + ResourceType string `json:"resource_type"` + ResourceObject map[string]any `json:"resource_object,omitempty"` + Config string `json:"config,omitempty"` + ImportConfig string `json:"import_config,omitempty"` } // ListCompleteMessage represents "query" result message of type "list_complete"
diff --git a/logging_test.go b/logging_test.go index f616789..de34a24 100644 --- a/logging_test.go +++ b/logging_test.go
@@ -3,7 +3,6 @@ package tfjson import ( - "encoding/json" "testing" "time" @@ -131,9 +130,9 @@ Address: "list.concept_pet.pets", ResourceType: "concept_pet", DisplayName: "This is a easy-antelope", - Identity: map[string]json.RawMessage{ - "id": json.RawMessage(`"easy-antelope"`), - "legs": json.RawMessage("6"), + Identity: map[string]any{ + "id": "easy-antelope", + "legs": float64(6), }, IdentityVersion: 1, },