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:
@@ -72,20 +72,6 @@ func NewGraph(name string) (*Graph, error) {
|
||||
return g, nil
|
||||
}
|
||||
|
||||
// NewVertex returns whatever was passed in. This is for compatibility with the
|
||||
// usage of the old NewVertex method. This is considered deprecated.
|
||||
// FIXME: remove me
|
||||
func NewVertex(x Vertex) Vertex {
|
||||
return x
|
||||
}
|
||||
|
||||
// NewEdge returns whatever was passed in. This is for compatibility with the
|
||||
// usage of the old NewEdge method. This is considered deprecated.
|
||||
// FIXME: remove me
|
||||
func NewEdge(x Edge) Edge {
|
||||
return x
|
||||
}
|
||||
|
||||
// Value returns a value stored alongside the graph in a particular key.
|
||||
func (g *Graph) Value(key string) (interface{}, bool) {
|
||||
val, exists := g.kv[key]
|
||||
|
||||
Reference in New Issue
Block a user