don't use type assertion
This commit is contained in:
parent
1fe8fbf827
commit
e973c51abc
4
main.go
4
main.go
|
@ -51,14 +51,14 @@ func getGamePk() string {
|
|||
|
||||
func extractPatches(diffPatch []byte) ([]jsonpatch.Patch, error) {
|
||||
var patches []jsonpatch.Patch
|
||||
var objs []any
|
||||
var objs []map[string]any
|
||||
err := json.Unmarshal(diffPatch, &objs)
|
||||
if err != nil {
|
||||
return patches, err
|
||||
}
|
||||
|
||||
for _, obj := range objs {
|
||||
diff := obj.(map[string]any)["diff"]
|
||||
diff := obj["diff"]
|
||||
patch, err := json.Marshal(diff)
|
||||
if err != nil {
|
||||
return patches, err
|
||||
|
|
Loading…
Reference in New Issue