diff --git a/docs/convertor.md b/docs/convertor.md index 565915f..767bf7d 100644 --- a/docs/convertor.md +++ b/docs/convertor.md @@ -608,16 +608,16 @@ import ( func main() { val := reflect.ValueOf("abc") - iVal, ok := convertor.ToInterface(val) + iVal, ok := convertor.ToInterface(val) - fmt.Printf("%T\n", iVal) - fmt.Printf("%v\n", iVal) - fmt.Println(ok) + fmt.Printf("%T\n", iVal) + fmt.Printf("%v\n", iVal) + fmt.Println(ok) - // Output: - // string - // abc - // true + // Output: + // string + // abc + // true } ``` diff --git a/docs/convertor_zh-CN.md b/docs/convertor_zh-CN.md index 0661461..db0c07f 100644 --- a/docs/convertor_zh-CN.md +++ b/docs/convertor_zh-CN.md @@ -608,16 +608,16 @@ import ( func main() { val := reflect.ValueOf("abc") - iVal, ok := convertor.ToInterface(val) + iVal, ok := convertor.ToInterface(val) - fmt.Printf("%T\n", iVal) - fmt.Printf("%v\n", iVal) - fmt.Println(ok) + fmt.Printf("%T\n", iVal) + fmt.Printf("%v\n", iVal) + fmt.Println(ok) - // Output: - // string - // abc - // true + // Output: + // string + // abc + // true } ``` diff --git a/docs/datetime.md b/docs/datetime.md index 30deea6..0a74886 100644 --- a/docs/datetime.md +++ b/docs/datetime.md @@ -199,18 +199,18 @@ import ( func main() { now := time.Now() - after1Year := datetime.AddYear(now, 1) - diff1 := after1Year.Sub(now) + after1Year := datetime.AddYear(now, 1) + diff1 := after1Year.Sub(now) - before1Year := datetime.AddYear(now, -1) - diff2 := before1Year.Sub(now) + before1Year := datetime.AddYear(now, -1) + diff2 := before1Year.Sub(now) - fmt.Println(diff1) - fmt.Println(diff2) + fmt.Println(diff1) + fmt.Println(diff2) - // Output: - // 8760h0m0s - // -8760h0m0s + // Output: + // 8760h0m0s + // -8760h0m0s } ``` diff --git a/docs/datetime_zh-CN.md b/docs/datetime_zh-CN.md index b0636a2..1a1a619 100644 --- a/docs/datetime_zh-CN.md +++ b/docs/datetime_zh-CN.md @@ -200,18 +200,18 @@ import ( func main() { now := time.Now() - after1Year := datetime.AddYear(now, 1) - diff1 := after1Year.Sub(now) + after1Year := datetime.AddYear(now, 1) + diff1 := after1Year.Sub(now) - before1Year := datetime.AddYear(now, -1) - diff2 := before1Year.Sub(now) + before1Year := datetime.AddYear(now, -1) + diff2 := before1Year.Sub(now) - fmt.Println(diff1) - fmt.Println(diff2) + fmt.Println(diff1) + fmt.Println(diff2) - // Output: - // 8760h0m0s - // -8760h0m0s + // Output: + // 8760h0m0s + // -8760h0m0s } ``` diff --git a/docs/function.md b/docs/function.md index d295b51..c6dfd76 100644 --- a/docs/function.md +++ b/docs/function.md @@ -323,16 +323,16 @@ import ( func main() { addOne := func(x interface{}) interface{} { - return x.(int) + 1 - } - double := func(x interface{}) interface{} { - return 2 * x.(int) - } - square := func(x interface{}) interface{} { - return x.(int) * x.(int) - } + return x.(int) + 1 + } + double := func(x interface{}) interface{} { + return 2 * x.(int) + } + square := func(x interface{}) interface{} { + return x.(int) * x.(int) + } - f := function.Pipeline(addOne, double, square) + f := function.Pipeline(addOne, double, square) result := fn(2) diff --git a/docs/function_zh-CN.md b/docs/function_zh-CN.md index caad855..a8e15bb 100644 --- a/docs/function_zh-CN.md +++ b/docs/function_zh-CN.md @@ -322,16 +322,16 @@ import ( func main() { addOne := func(x interface{}) interface{} { - return x.(int) + 1 - } - double := func(x interface{}) interface{} { - return 2 * x.(int) - } - square := func(x interface{}) interface{} { - return x.(int) * x.(int) - } + return x.(int) + 1 + } + double := func(x interface{}) interface{} { + return 2 * x.(int) + } + square := func(x interface{}) interface{} { + return x.(int) * x.(int) + } - f := function.Pipeline(addOne, double, square) + f := function.Pipeline(addOne, double, square) result := fn(2) diff --git a/docs/netutil.md b/docs/netutil.md index d818765..2956b25 100644 --- a/docs/netutil.md +++ b/docs/netutil.md @@ -658,24 +658,24 @@ import ( func main() { url := "https://jsonplaceholder.typicode.com/todos" header := map[string]string{ - "Content-Type": "application/x-www-form-urlencoded", - // "Content-Type": "multipart/form-data", - } + "Content-Type": "application/x-www-form-urlencoded", + // "Content-Type": "multipart/form-data", + } - postData := url.Values{} - postData.Add("userId", "1") - postData.Add("title", "TestToDo") + postData := url.Values{} + postData.Add("userId", "1") + postData.Add("title", "TestToDo") - // postData := make(map[string]string) - // postData["userId"] = "1" - // postData["title"] = "title" + // postData := make(map[string]string) + // postData["userId"] = "1" + // postData["title"] = "title" - resp, err := netutil.HttpPost(apiUrl, header, nil, postData) - if err != nil { - log.Fatal(err) - } - body, _ := io.ReadAll(resp.Body) - t.Log("response: ", resp.StatusCode, string(body)) + resp, err := netutil.HttpPost(apiUrl, header, nil, postData) + if err != nil { + log.Fatal(err) + } + body, _ := io.ReadAll(resp.Body) + t.Log("response: ", resp.StatusCode, string(body)) } ``` diff --git a/docs/netutil_zh-CN.md b/docs/netutil_zh-CN.md index 9d2e996..ea3e687 100644 --- a/docs/netutil_zh-CN.md +++ b/docs/netutil_zh-CN.md @@ -657,23 +657,23 @@ import ( func main() { url := "https://jsonplaceholder.typicode.com/todos" header := map[string]string{ - "Content-Type": "application/x-www-form-urlencoded", - // "Content-Type": "multipart/form-data", - } + "Content-Type": "application/x-www-form-urlencoded", + // "Content-Type": "multipart/form-data", + } - postData := url.Values{} - postData.Add("userId", "1") - postData.Add("title", "TestToDo") + postData := url.Values{} + postData.Add("userId", "1") + postData.Add("title", "TestToDo") - // postData := make(map[string]string) - // postData["userId"] = "1" - // postData["title"] = "title" + // postData := make(map[string]string) + // postData["userId"] = "1" + // postData["title"] = "title" - resp, err := netutil.HttpPost(apiUrl, header, nil, postData) - if err != nil { - log.Fatal(err) - } - body, _ := io.ReadAll(resp.Body) + resp, err := netutil.HttpPost(apiUrl, header, nil, postData) + if err != nil { + log.Fatal(err) + } + body, _ := io.ReadAll(resp.Body) fmt.Println(body) } ```