随笔分类 -  学GO

使用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 阅读(29) 评论(0) 推荐(0) 编辑

使用Go调用Powershell加域
摘要:```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 阅读(128) 评论(0) 推荐(0) 编辑

kubectl的vistor模式
摘要: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 阅读(35) 评论(0) 推荐(0) 编辑

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

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

GO中的Flag包和指针相关
摘要:方式一 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 阅读(33) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示