Skip to content

Commit

Permalink
πŸ“ docs: update document
Browse files Browse the repository at this point in the history
  • Loading branch information
jingyuexing committed Jan 2, 2024
1 parent ee8b4f9 commit f43cdc2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,26 @@ This is a method or function that I often use
## usage

```go
func Template(source string, data map[string]string) string
func Template(source string, data map[string]string, placeholder string) string
```
- This function can perform template string substitution

[see test case](utils_test.go#L10-L82)

```go
func GetPathValue(raw string, realPath string) map[string]string
```
- This string will directly get the value corresponding to the template [see test case](./utils/utils_test.go)
- This string will directly get the value corresponding to the template [see test case](utils_test.go#L91-L100)

```go
func (c *Cookie) NewCookie(cookie string, delimiter string, joiner string) *Cookie
```
- This can parse the Cookie string or parse the Query string, you can specify separators and connectors for parsing [see test case](utils/utils_test.go#L22)
- This can parse the Cookie string or parse the Query string, you can specify separators and connectors for parsing [see test case](utils_test.go#L22)


```go
func Map2Struct(source map[string]any, bindingTarget any)
```
- You can bind the value of the map to the structure, provided that the fields of the structure and the fields of the map are consistent in lowercase [see test case](./utils/utils_test.go#L40)
- You can bind the value of the map to the structure, provided that the fields of the structure and the fields of the map are consistent in lowercase [see test case](utils_test.go#L102-L105)


0 comments on commit f43cdc2

Please sign in to comment.