As a flutter developer, it can be really cumbersome having to create directories and files for your project all the time 😓. Every flutter project, ...
For further actions, you may consider blocking this person and/or reporting abuse
I'd like to offer some feedback.
Your concatenation
fmt.Sprintf("/%v/%v"...produces absolute paths starting at root. It probably works right now just becauseos.Args[1]returns an absolute path. But if a relative path is provided I believe that the code will not work as intended.Actually avoid using
fmt.Sprintfto join paths to begin with. Even if you remove the leading/character, the produced path would work only on Unix platforms and not always. The correct approach is to use filepath.Join. This takes the OS into consideration and on Windows it would use\instead of/. Additionally it does some cleaning up of the path but you can check the details in the godoc. You would need to use the same in your map initialization as well or you can use os.PathSeparator instead of/or you could give filepath.FromSlash a try.You can consider using
log.Print*instead offmt.Print. This one is a bit nit picking but there is a difference worth mentioning, which might not be relevant in your particular case.The
logpackage outputs tostderr, whereasfmtoutputs tostdout. And the general pattern for UNIX tools is for a CLI/tool to output info logs tostderrand content tostdout. That way tools can be piped and the stdout content would be passed to the subsequent tool, whereas the stderr logs would be printed for debugging purposes. Now, in your case you won't really be piping your tool's output, so this might not be worthwhile.Thanks for the feedback. Very appreciated 🤙
Would you be open to connect? I would love to have some discussions with you about go.