sdboyer / gogl

A graph library in Go
MIT License
77 stars 13 forks source link

/Quickstart example fails to compile #35

Closed hoijui closed 3 years ago

hoijui commented 3 years ago

using latest master (github.com/sdboyer/gogl v0.4.1-0.20190821134550-a7d439139054), with the code from your example in the README:

    // gogl uses a builder to specify the kind of graph you want.
    graph := gogl.Spec().
        // The graph should be mutable. Default is immutable.
        Mutable().
        // The graph should have directed edges (arcs). Default is undirected.
        Directed().
        // The graph's edges are plain - no labels, weights, etc. This is the default.
        //Basic().
        Labeled().
        // No loops or parallel edges. This is the default.
        SimpleGraph().
        // al.G picks and returns an adjacency list-based graph, based on the spec.
        Create(al.G).
    // The builder always returns a Graph; type assert to get access to add/remove methods.
    (gogl.MutableGraph)

I get:

panic: interface conversion: *al.labeledDirected is not gogl.MutableGraph: missing method AddEdges

goroutine 1 [running, locked to thread]:
main.readGraph(0x0, 0x0)
    /home/user/Projects/GraManBro-go/main.go:60 +0x71
main.main()
    /home/user/Projects/GraManBro-go/main.go:149 +0x1c7

It happens both with Basic(). and withLabeled().`.

sdboyer commented 3 years ago

oh man. i should archive this repo. Totally relic of the past - not supported. Sorry!