随笔分类 -  学GO

摘要:```golang package main import ( "bytes" "encoding/json" "fmt" "net/http" "crypto/tls" "net/url" "strings" "regexp" "bufio" "os" ) var ( //client *http 阅读全文

posted @ 2023-08-18 14:09 yangras 阅读(82) 评论(0) 推荐(0)

摘要:```golang package main import ( "fmt" "github.com/go-ldap/ldap/v3" "github.com/mozillazg/go-pinyin" "os" "os/exec" "strings" "time" ) func ChineseToAb 阅读全文

posted @ 2023-07-28 17:19 yangras 阅读(209) 评论(0) 推荐(0)

摘要:package main import ( "encoding/json" "encoding/xml" "log" ) type Visitor func(shape Shape) type Shape interface { accept(Visitor) } type Circle struc 阅读全文

posted @ 2022-04-19 14:49 yangras 阅读(46) 评论(0) 推荐(0)

摘要:Context主要分两种,一种是实现超时控制的cancelCtx,一种是传递值得valueCtx。 type Context interface { Deadline() (deadline time.Time, ok bool) Done() <-chan struct{} Err() error 阅读全文

posted @ 2022-01-25 22:44 yangras 阅读(54) 评论(0) 推荐(0)

摘要:方式一 package main import ( "flag" "fmt" ) func main() { var name =new(string)// [1] flag.StringVar(name, "name", "everyone", "The greeting object.") // 阅读全文

posted @ 2021-06-09 16:23 yangras 阅读(47) 评论(0) 推荐(0)

导航