import{_ as s,o as a,c as n,X as l}from"./chunks/framework.6e839c56.js";const g=JSON.parse('{"title":"安装","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"guide/getting_started.md","filePath":"guide/getting_started.md"}'),o={name:"guide/getting_started.md"},p=l(`
go get github.com/duke-git/lancet/v2 // will install latest version of v2.x.xgo get github.com/duke-git/lancet/v2 // will install latest version of v2.x.xgo get github.com/duke-git/lancet // below go1.18, install latest version of v1.x.xgo get github.com/duke-git/lancet // below go1.18, install latest version of v1.x.xlancet 是以包的结构组织代码的,使用时需要导入相应的包名。例如:如果使用字符串相关函数,需要导入 strutil 包:
import "github.com/duke-git/lancet/v2/strutil"import "github.com/duke-git/lancet/v2/strutil"此处以字符串工具函数 Reverse(逆序字符串)为例,需要导入 strutil 包:
package main
import (
"fmt"
"github.com/duke-git/lancet/v2/strutil"
)
func main() {
s := "hello"
rs := strutil.Reverse(s)
fmt.Println(rs) //olleh
}package main
import (
"fmt"
"github.com/duke-git/lancet/v2/strutil"
)
func main() {
s := "hello"
rs := strutil.Reverse(s)
fmt.Println(rs) //olleh
}其他特性请参考API.
`,13),e=[p];function t(c,r,i,y,F,d){return a(),n("div",null,e)}const h=s(o,[["render",t]]);export{g as __pageData,h as default};