https://github.com/hongyukeji/go-utils
https://github.com/hongyukeji/go-utils
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hongyukeji/go-utils
- Owner: hongyukeji
- License: mit
- Created: 2023-07-27T07:53:17.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-07-27T08:25:53.000Z (almost 2 years ago)
- Last Synced: 2025-01-03T16:35:05.499Z (5 months ago)
- Language: Go
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-utils
### 安装
To download the specific tagged release, run:
```bash
go get -u github.com/hongyukeji/[email protected]
```
Import it in your program as:
```go
import "github.com/hongyukeji/go-utils"
```
It requires Go 1.11 or later due to usage of Go Modules.Refer to the documentation here:
https://github.com/hongyukeji/go-utilsThe rest of this document describes the the advances in v1 and a list of
breaking changes for users that wish to upgrade from an earlier version.### 使用
#### string 字符串
##### TextTemplateFormat()
```go
package mainimport (
"fmt"
"github.com/hongyukeji/go-utils/utils"
)func main() {
text := "您的验证码为: ${code}"
params := map[string]string{"code": "1234"}
template := utils.TextTemplateFormat(text, params)
fmt.Println(template)
}```