Skip to content

Instantly share code, notes, and snippets.

@chantra
Created October 24, 2015 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chantra/6f2d74e3bc38aadcdc1e to your computer and use it in GitHub Desktop.
Save chantra/6f2d74e3bc38aadcdc1e to your computer and use it in GitHub Desktop.
package netlink
import (
"encoding/hex"
"fmt"
"os/exec"
"github.com/vishvananda/netlink/nl"
)
func runCommand(cmd string, args ...string) {
command := exec.Command(cmd, args...)
out, err := command.CombinedOutput()
if err == nil {
fmt.Printf("%s\n", out)
}
}
func dumpRequest(req nl.NetlinkRequest) {
out := hex.Dump(req.Serialize())
fmt.Printf("%s\n", out)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment