Skip to content

Instantly share code, notes, and snippets.

@zianwar
Last active February 11, 2020 03:35
Show Gist options
  • Save zianwar/845ae1cd3c26acf8df9968aa506f3a66 to your computer and use it in GitHub Desktop.
Save zianwar/845ae1cd3c26acf8df9968aa506f3a66 to your computer and use it in GitHub Desktop.
Graphvis Golang
package main
import (
"fmt"
"github.com/awalterschulze/gographviz"
)
func main() {
g := gographviz.NewGraph()
g.SetName("G")
g.SetDir(true)
g.AddNode("G", "A", nil)
g.AddNode("G", "B", nil)
g.AddEdge("A", "B", true, nil)
s := g.String()
fmt.Println(s)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment