Created
July 31, 2020 09:09
-
-
Save thanhpp/444c143e60308770f1e55a470e41eb0b to your computer and use it in GitHub Desktop.
bug in golang function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//BuildMap export a simple link map from graphviz | |
func BuildMap(name string, path string) (eMap *ExportMap, err error) { | |
gr, err := readGraphvizFile(path) | |
if err != nil { | |
return nil, err | |
} | |
s, err := linkNode(gr) | |
if err != nil { | |
return nil, err | |
} | |
eMap.Name = name | |
eMap.Path = path | |
for _, node := range s.Nodes { | |
var newNode exportNode | |
newNode.Name = node.Name | |
newNode.Parrent = append(newNode.Parrent, node.ParrentName...) | |
newNode.Children = append(newNode.Children, node.ChildrenName...) | |
eMap.Nodes = append(eMap.Nodes, newNode) | |
} | |
return eMap, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
//BuildMap export a simple link map from graphviz
//var eMap = make(map...) or sth here