mongodb json tag

This commit is contained in:
zhuyasen
2024-03-05 00:39:41 +08:00
parent 20bd7c060f
commit 5734b2d4be
11 changed files with 33 additions and 30 deletions

View File

@@ -345,6 +345,7 @@ func Test_getMongodbTableFields(t *testing.T) {
},
}
SetJSONTagCamelCase()
goStructs := MgoFieldToGoStruct("foobar", fields)
t.Log(goStructs)
@@ -363,6 +364,7 @@ func Test_getMongodbTableFields(t *testing.T) {
_ = codes
//printCode(codes)
SetJSONTagSnakeCase()
sql, fieldsMap = ConvertToSQLByMgoFields("foobar", fields)
t.Log(sql)
opts = []Option{