3 Star 0 Fork 0

carlmax_my/console-core-go

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ip_linux.go 426 Bytes
一键复制 编辑 原始数据 按行查看 历史
carlmax_my 提交于 2025-06-22 14:18 +08:00 . clean code
//go:build linux
// +build linux
package ip_util
import (
"log"
"gitee.com/carlmax_my/console-core-go/pkg/sys/exec"
)
// only for linux
func FlushAddr(iface string) error {
// 清除接口上的所有地址,但保留接口配置, 同时保持接口的up状态
out, err := exec.ExecCmd("ip", "addr", "flush", "dev", iface)
if err != nil {
return err
}
log.Printf("FlushAddr success: %s\n", out)
return nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/carlmax_my/console-core-go.git
git@gitee.com:carlmax_my/console-core-go.git
carlmax_my
console-core-go
console-core-go
v1.0.33

搜索帮助