Do you have any recommendation on any open source tool that can help me in creating (a UML like) business and technical model for a open source Go application?
@christophberger, any recommendations from you per your response in the thread Are you aware of any obfuscation method/tool for go?
Your thoughts will be appreciated.
I have used nomnoml before, which is a browser-side DSL syntax to UML-like charts open-source project. It’s pretty handy and you can get some okay looking flow- and state-charts quickly
Hi @flexd, thank you for your response. I visited nomnoml site, and it looks like it will work for one file at a time.
I am looking for a tool that can crawl golang based app directory and create those artifacts.
Umm, not sure what code obfuscation has to do with business models and UML…
I am afraid I cannot recommend anything, as I don’t know any modeling tools for Go. A quick search for “UML golang” reveals go-diagram, an UML editor for Go, and goviz, a dependency visualizer for Go packages. However, these tools are made for analysis rather than for creating models.
Indeed it seems not easy to find an UML modeling tool that generates Go code from the model (if this is what you are searching for). I guess the problem is that UML is tailored for object-oriented languages, which Go clearly isn’t. Where OO languages emphasize the object as the central building block (thus promoting a “world of nouns”), Go emphasizes the action (the “verbs”). Hence I daresay that the UML way of modeling might produce substandard Go code and therefore might be frowned upon among Go developers who love clear, readable source code. (Although I may be wrong, I have little to no experience with UML.)
Hi @christophberger, thank you for your input.
My request has nothing to do with obfuscation but mererly to bring a reference point made by you in that thread.
I am not interested in generating golang code from UML like model but to generate reverse engineering artifacts from an existing Golang application. But, in future if generating of template code from a (DSL like) model is possible, then, why not? I will take any tooling that saves time and provides initial acceleration.
I will try go-diagram and goviz and update you with my findings.
Here is a cool article about reversing Go binaries using IDA Pro: https://rednaga.io/2016/09/21/reversing_go_binaries_like_a_pro/
It provides some execution visualization.
Hi @CurtGreen, thank you for your suggestion. Does it work against a local code repo (folder) ?
I don’t know what there would be to reverse engineer if you have the code repository in hand. You could read the Go code, which would be more concise than anything else.
Actually if you have the code you could wire it up to the pprof tool, and get some indepth execution analysis. You could even use torch for better visualizations. https://blog.golang.org/profiling-go-programs
Thanks for clarifying. Indeed, in this case, go-diagram and goviz might be the tools you are looking for. However, simply reading the code can already bring you quite far. After all, Go was designed with code readability in mind. (And as @CurtGreen points out, the code itself is the most concise representation of the code.)
Hi @christophberger and @CurtGreen,
I truly appreciate your quick responses to my requests.
I am relatively new to the Golang world but delivering software solutions over 2 decades.
I have taken basic programming courses and am now learning web development using Go.
My primary interest is to use existing Golang API code that uses google protocol buffers, bazel etc; understand the overall APIs and plan out refactoring effort as I am learning the this technical stack.
As much as I have learned and appreciate the beauty of Go code and the power of the language; it is always necessary to take a quick estimate on LOEs (Level of Efforts) for planning refactoring and redesigning of the work; that potentially will help me in engaging necessary set of resources while having an effecting and relevant dialogue with them.
Generated design artifacts will also be a good lead to create design artifacts for to be refactored code.
I will review your suggested tools and then will come back to you with my findings.
Thank you again and have a wonderful evening ahead.
I couldn’t get either go-diagram or goviz installed on windows 10 pc.
I installed goviz via chocolatey; but then goviz command from the example “goviz -i github.com/mattn/anko | dot -Tpng -o anko.png” couldn’t be recognized. I was trying to run that command from the folder that contained the tool.
For go-diagram I tried running the go-diagram command from the folder having cloned repo from GitHub.
I would appreciate your thoughts.
.\goviz to invoke goviz in the current folder if your PATH variable does not include the current directory. Also, the command line you posted shows that goviz needs dot, which is a third-party tool. Do you have dot installed? Other than that, I have no idea what else could be the problem. I have next to no exposure to Windows and can only do guesswork here.
go-diagram may have the same problem as goviz. If
.\go-diagram does not help, please post the error messages here. They might help finding out what’s going on.
What is the exact error you get?
Also, are you trying to run those on
cmd or PowerShell terminals, the WSL, or inside of a POSIX-wrapper like Cygwin, MSYS2 or git-bash?
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.