Chore: Avoid simplejson usage in xorm module (#101943)

avoid simplejson usage
This commit is contained in:
Will Browne
2025-03-11 14:24:20 +00:00
committed by GitHub
parent 6b2c73141d
commit c74a5fcbed
3 changed files with 3 additions and 10 deletions
+3 -4
View File
@@ -1,12 +1,11 @@
package xorm
import (
"encoding/json"
"testing"
_ "github.com/mattn/go-sqlite3"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/components/simplejson"
)
func TestBasicOperationsWithSqlite(t *testing.T) {
@@ -38,7 +37,7 @@ func testBasicOperations(t *testing.T, eng *Engine) {
require.NoError(t, err)
require.NotZero(t, obj.Id)
obj.Json = simplejson.MustJson([]byte(`{"test": "test", "key": null}`))
obj.Json = json.RawMessage(`{"test": "test", "key": null}`)
_, err = sess.Update(obj)
require.NoError(t, err)
})
@@ -47,5 +46,5 @@ func testBasicOperations(t *testing.T, eng *Engine) {
type TestStruct struct {
Id int64
Comment string
Json *simplejson.Json
Json json.RawMessage
}