diff --git a/README.md b/README.md index befef26..7e7a841 100644 --- a/README.md +++ b/README.md @@ -78,9 +78,9 @@ The new Graph can be added with associated attributes as following: ```GO attributes := map[string]interface{}{ - "default_weight": 1.1, - "acyclic": false, - "max_depth": 10, + "default_weight": 1.1, + "acyclic": false, + "max_depth": 10, } graph, err := gml.AddGraph("the graph", EdgeDirectionDirected, attributes) @@ -98,9 +98,9 @@ The Node elements can be added to the Graph as following: ```GO attributes := map[string]interface{}{ - "X": 0.1, - "Y": 1.0, - "NodeNeuronType": network.InputNeuron, + "X": 0.1, + "Y": 1.0, + "NodeNeuronType": network.InputNeuron, "NodeActivationType": network.NullActivation, } @@ -118,8 +118,8 @@ The Edge elements can be added to the Graph as following: ```GO attributes := map[string]interface{}{ - "weight": -1.1, - "sourceId": 1, + "weight": -1.1, + "sourceId": 1, "targetId": 3, } diff --git a/graphml/graphml_test.go b/graphml/graphml_test.go index 862c72b..826279d 100644 --- a/graphml/graphml_test.go +++ b/graphml/graphml_test.go @@ -48,10 +48,11 @@ func TestGraphML_Decode_keyTypeDefault(t *testing.T) { require.NoError(t, err, "failed to decode") // test results - attributes := make(map[string]interface{}) - attributes["integer-key"] = 10 - attributes["test-key"] = "test data" - attributes["color"] = "yellow" + attributes := map[string]interface{}{ + "integer-key": 10, + "test-key": "test data", + "color": "yellow", + } // check Graph element //