minor style changes
This commit is contained in:
parent
de7e998722
commit
5e98696cac
7
main.go
7
main.go
|
@ -51,6 +51,7 @@ func getGamePk() string {
|
||||||
|
|
||||||
func extractPatches(diffPatch []byte) ([]jsonpatch.Patch, error) {
|
func extractPatches(diffPatch []byte) ([]jsonpatch.Patch, error) {
|
||||||
var patches []jsonpatch.Patch
|
var patches []jsonpatch.Patch
|
||||||
|
|
||||||
var objs []map[string]any
|
var objs []map[string]any
|
||||||
err := json.Unmarshal(diffPatch, &objs)
|
err := json.Unmarshal(diffPatch, &objs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -61,17 +62,17 @@ func extractPatches(diffPatch []byte) ([]jsonpatch.Patch, error) {
|
||||||
diff := obj["diff"]
|
diff := obj["diff"]
|
||||||
patch, err := json.Marshal(diff)
|
patch, err := json.Marshal(diff)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return patches, err
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
p, err := jsonpatch.DecodePatch(patch)
|
p, err := jsonpatch.DecodePatch(patch)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return patches, err
|
break
|
||||||
}
|
}
|
||||||
patches = append(patches, p)
|
patches = append(patches, p)
|
||||||
}
|
}
|
||||||
|
|
||||||
return patches, nil
|
return patches, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateFeed(feedResp []byte, gamePk, ts, updateId string) ([]byte, error) {
|
func updateFeed(feedResp []byte, gamePk, ts, updateId string) ([]byte, error) {
|
||||||
|
|
Loading…
Reference in New Issue