pgraph: Remove NewVertex and NewEdge methods and fix examples
Since the pgraph graph can store arbitrary pointers, we don't need a special method to create the vertices or edges as long as they implement the String() string method. This cleans up the library and some of the examples which I let rot previously.
This commit is contained in:
@@ -68,9 +68,8 @@ func (obj *MyGAPI) Graph() (*pgraph.Graph, error) {
|
||||
MetaParams: metaparams,
|
||||
},
|
||||
}
|
||||
v := pgraph.NewVertex(n0)
|
||||
g.AddVertex(n0)
|
||||
|
||||
g.AddVertex(v)
|
||||
//g, err := config.NewGraphFromConfig(obj.data.Hostname, obj.data.World, obj.data.Noop)
|
||||
return g, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user