2024年6月29日

Linux veth口名字不能超过15个字符

摘要: ip link add name aaaaaaaaaaaaaaa type veth peer name bbbbbbbbbbbbbbb ip link add name aaaaaaaaaaaaaaaa type veth peer name bbbbbbbbbbbbbbbb veth口名字15个 阅读全文

posted @ 2024-06-29 17:50 王景迁 阅读(2) 评论(0) 推荐(0) 编辑

监听ctrl+c和15信号

摘要: function quit() { time=$(date "+%Y-%m-%d %H:%M:%S") echo "$time quit" exit 0 } # 捕捉ctrl+c trap quit SIGINT # 捕捉15 trap quit SIGTERM while true do slee 阅读全文

posted @ 2024-06-29 17:44 王景迁 阅读(5) 评论(0) 推荐(0) 编辑

go defer读不到最新error

摘要: package main import ( "errors" "fmt" ) func main() { err := errors.New("err1") defer fmt.Println(err.Error()) err = errors.New("err2") } defer只会记住执行到此 阅读全文

posted @ 2024-06-29 17:22 王景迁 阅读(2) 评论(0) 推荐(0) 编辑

go本地unix socket

摘要: common.go package common const ( SocketPath = "/run/test.sock" ) type Request struct { Age int `json:"age"` } type Response struct { Err string `json: 阅读全文

posted @ 2024-06-29 17:14 王景迁 阅读(2) 评论(0) 推荐(0) 编辑

导航