f-14: code: add delete interface function #14
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
fd4c7e9a3a
commit
db222b383c
1 changed files with 13 additions and 0 deletions
13
internal/netif/delete.go
Normal file
13
internal/netif/delete.go
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
package netif
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/vishvananda/netlink"
|
||||||
|
)
|
||||||
|
|
||||||
|
func DeleteLink(name string) error {
|
||||||
|
link, err := netlink.LinkByName(name)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return netlink.LinkDel(link)
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue