mirror of
https://gitee.com/johng/gf
synced 2026-06-06 16:21:40 +08:00
fix: 修正 JSON 标签中的空白字符
This commit is contained in:
@ -1151,7 +1151,7 @@ func Test_NameFromJsonTag(t *testing.T) {
|
||||
gtest.C(t, func(t *gtest.T) {
|
||||
type CreateReq struct {
|
||||
gmeta.Meta `path:"/CreateReq" method:"POST"`
|
||||
Name string `json:"nick_name, omitempty"`
|
||||
Name string `json:"nick_name,omitempty"`
|
||||
}
|
||||
|
||||
var (
|
||||
@ -1172,7 +1172,7 @@ func Test_NameFromJsonTag(t *testing.T) {
|
||||
gtest.C(t, func(t *gtest.T) {
|
||||
type CreateReq struct {
|
||||
gmeta.Meta `path:"/CreateReq" method:"GET"`
|
||||
Name string `json:"nick_name, omitempty" in:"header"`
|
||||
Name string `json:"nick_name,omitempty" in:"header"`
|
||||
}
|
||||
var (
|
||||
err error
|
||||
|
||||
@ -1,3 +1,9 @@
|
||||
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://github.com/gogf/gf.
|
||||
|
||||
package gconv_test
|
||||
|
||||
import (
|
||||
|
||||
@ -70,6 +70,9 @@ var stringTests = []struct {
|
||||
{gvar.New(123), "123"},
|
||||
{gvar.New(123.456), "123.456"},
|
||||
|
||||
{myString("123"), "123"},
|
||||
{(*myString)(nil), ""},
|
||||
|
||||
{goTime, "1911-10-10 00:00:00 +0000 UTC"},
|
||||
{&goTime, "1911-10-10 00:00:00 +0000 UTC"},
|
||||
// TODO The String method of gtime not equals to time.Time
|
||||
@ -77,6 +80,7 @@ var stringTests = []struct {
|
||||
{&gfTime, "1911-10-10 00:00:00"},
|
||||
//{gfTime, "1911-10-10 00:00:00 +0000 UTC"},
|
||||
//{&gfTime, "1911-10-10 00:00:00 +0000 UTC"},
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user