-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
27 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,30 +21,7 @@ Golang 1.16+ | |
## Installation | ||
|
||
```shell | ||
go get -u github.com/zc2638/[email protected] | ||
``` | ||
|
||
## Use note: | ||
The time.time type uses jsonTag to parse it into a string type | ||
```go | ||
type XXX struct{ | ||
Now time.Time `json:",string"` | ||
} | ||
``` | ||
|
||
The compatibility is resolved as follows: | ||
```go | ||
type xxx struct { | ||
MapSlicePtr map[string][]*string | ||
MapSlice map[string][]string | ||
MapSliceStructPtr map[string][]*Person | ||
MapSliceStruct map[string][]Person | ||
SliceStructPtr *[]*Person | ||
SliceStruct *[]Person | ||
SliceStringPtr *[]*string | ||
SliceString *[]string | ||
} | ||
|
||
go get -u github.com/zc2638/[email protected] | ||
``` | ||
|
||
**Tip:** As of `v1.2.0`, lower versions are no longer compatible. In order to be compatible with most web frameworks, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,30 +21,7 @@ Golang 1.16+ | |
## 安装 | ||
|
||
```shell | ||
go get -u github.com/zc2638/[email protected] | ||
``` | ||
|
||
## 使用注意: | ||
time.time类型使用jsonTag来将其解析为string类型 | ||
```go | ||
type XXX struct{ | ||
Now time.Time `json:",string"` | ||
} | ||
``` | ||
|
||
兼容的解析如下: | ||
```go | ||
type xxx struct { | ||
MapSlicePtr map[string][]*string | ||
MapSlice map[string][]string | ||
MapSliceStructPtr map[string][]*Person | ||
MapSliceStruct map[string][]Person | ||
SliceStructPtr *[]*Person | ||
SliceStruct *[]Person | ||
SliceStringPtr *[]*string | ||
SliceString *[]string | ||
} | ||
|
||
go get -u github.com/zc2638/[email protected] | ||
``` | ||
|
||
**Tip:** 从 `v1.2.0` 开始,低版本不再兼容。为了兼容大部分的web框架,整体架构做了很大的改动。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters