mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-30 00:40:24 +01:00
(experimental) upgraded to encoding/json/v2
This commit is contained in:
1 parent
4d4275c9aa
commit
97dd775455
125 files changed
+433
-364
No files matched your search
@@ -1,7 +1,7 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"encoding/json/v2"
|
||||
"slices"
|
||||
"sync"
|
||||
"testing"
|
||||
@@ -128,7 +128,7 @@ func TestCronAddAndRemove(t *testing.T) {
|
||||
"test5": `{"minutes":{"1":{}},"hours":{"2":{}},"days":{"3":{}},"months":{"4":{}},"daysOfWeek":{"5":{}}}`,
|
||||
}
|
||||
for k, v := range expectedSchedules {
|
||||
raw, err := json.Marshal(indexedJobs[k].schedule)
|
||||
raw, err := json.Marshal(indexedJobs[k].schedule, json.Deterministic(true))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package cron
|
||||
|
||||
import "encoding/json"
|
||||
import "encoding/json/v2"
|
||||
|
||||
// Job defines a single registered cron job.
|
||||
type Job struct {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"encoding/json/v2"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -59,7 +59,7 @@ func TestJobMarshalJSON(t *testing.T) {
|
||||
|
||||
j := Job{id: "test_id", schedule: s}
|
||||
|
||||
raw, err := json.Marshal(j)
|
||||
raw, err := json.Marshal(j, json.Deterministic(true))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package cron_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"encoding/json/v2"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -265,7 +265,7 @@ func TestNewSchedule(t *testing.T) {
|
||||
return
|
||||
}
|
||||
|
||||
encoded, err := json.Marshal(schedule)
|
||||
encoded, err := json.Marshal(schedule, json.Deterministic(true))
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to marshalize the result schedule: %v", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user