1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

doc: add go playground demo

This commit is contained in:
dudaodong
2023-06-01 14:11:57 +08:00
parent 286a187942
commit cbf8cfdffa
8 changed files with 43 additions and 14 deletions

View File

@@ -493,10 +493,14 @@ import "github.com/duke-git/lancet/v2/datetime"
[[play](https://go.dev/play/p/xS1eS2ejGew)]
- **<big>BetweenSeconds</big>** : returns the number of seconds between two times.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#BetweenSeconds)]
[[play](https://go.dev/play/p/n3YDRyfyXJu)]
- **<big>DayOfYear</big>** : returns which day of the year the parameter date `t` is.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#DayOfYear)]
[[play](https://go.dev/play/p/0hjqhTwFNlH)]
- **<big>IsWeekend</big>** : checks if passed time is weekend or not.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#IsWeekend)]
[[play](https://go.dev/play/p/cupRM5aZOIY)]
### 8. Datastructure package constains some common data structure. eg. list, linklist, stack, queue, set, tree, graph.
@@ -603,8 +607,11 @@ import "github.com/duke-git/lancet/v2/fileutil"
[[play](https://go.dev/play/p/OExTkhGEd3_u)]
- **<big>WriteBytesToFile</big>** : write bytes to target file.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#WriteBytesToFile)]
[[play](https://go.dev/play/p/s7QlDxMj3P8)]
- **<big>WriteStringToFile</big>** : write string to target file.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#WriteStringToFile)]
[[play](https://go.dev/play/p/GhLS6d8lH_g)]
### 10. Formatter contains some functions for data formatting.
@@ -814,8 +821,11 @@ import "github.com/duke-git/lancet/v2/mathutil"
[[play](https://go.dev/play/p/EjcZxfY7G_g)]
- **<big>Cos</big>** : return the cosine of the radian argument.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#Cos)]
[[play](https://go.dev/play/p/Sm89LoIfvFq)]
- **<big>Sin</big>** : return the sine of the radian argument.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#Sin)]
[[play](https://go.dev/play/p/TWMQlMywDsP)]
### 14. Netutil package contains functions to get net information and send http request.
@@ -1307,8 +1317,10 @@ import "github.com/duke-git/lancet/v2/strutil"
[[play](https://go.dev/play/p/2OAjgbmAqHZ)]
- **<big>ContainsAll</big>** : return true if target string contains all the substrings.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#ContainsAll)]
[[play](https://go.dev/play/p/KECtK2Os4zq)]
- **<big>ContainsAny</big>** : return true if target string contains any one of the substrings.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#ContainsAny)]
[[play](https://go.dev/play/p/dZGSSMB3LXE)]
- **<big>IsString</big>** : checks if the parameter value data type is string or not.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#IsString)]
[[play](https://go.dev/play/p/IOgq7oF9ERm)]
@@ -1392,6 +1404,8 @@ import "github.com/duke-git/lancet/v2/strutil"
[[play](https://go.dev/play/p/ZNL6o4SkYQ7)]
- **<big>HideString</big>** : Hide some chars in source string with param `replaceChar`.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#HideString)]
[[play](https://go.dev/play/p/pzbaIVCTreZ)]
### 21. System package contain some functions about os, runtime, shell command.