Skip to content

Latest commit

 

History

History
58 lines (46 loc) · 1.57 KB

README_zh-CN.md

File metadata and controls

58 lines (46 loc) · 1.57 KB

Golang实用程序库,带有其他功能,例如JavaScript / Python!

安装

go get -d github.com/xjh22222228/gosh

入门

package main

import (
    "fmt"
    "time"
    "github.com/xjh22222228/gosh/gstr"
    "github.com/xjh22222228/gosh/gslice"
    "github.com/xjh22222228/gosh/gtime"
)

func main() {
    s := gstr.Reverse("Hello World")
    fmt.Println(s) // => dlroW olleH
    

    months := []string{"Jan", "March", "April", "June"}
    deleteItem := gslice.Splice(&months, 4, 1, "May")
    fmt.Println(months, deleteItem)  // => [Jan March April June May] []
    
    // 格式化日期
    fmt.Println(gtime.Format(time.Now(), "YYYY-MM-DD HH:mm:ss"))
    // => 2021-03-12 21:25:37
}

可以在运行时文档中找到更多详细信息。

贡献

感谢您的帮助!