Good developers need good tools

Tony Vu
2 min readNov 12, 2020

--

I finally got my hand on Lab 7 of Open Source Development topics. This week we learn about static analysis toolings which used a lot to assist developers writing their codes. What those toolings do is to help with formatting and identifying potential bugs in your codes and make the code easier to follow and more maintainable.

My task was to integrate these tools in my URL checker program. In my opinion, this is not a challenging lab. You just need to read the instructions carefully and follow the steps being laid out. I added a CONTRIBUTING.md file to hold all documentations about setting up the environment. This would help future contributors to get my program run for development without any issue. I also added a .vscode folder to customize VSCode configuration. In this folder, there are two file naming setting.json and extensions.json. The extensions.json file holds all the VSCode extensions that I would recommend contributors to have in their editor to have the consistent format. The setting.json file hold information about how I would like the code to be formatted when adding new codes. In this one, I simply put most of the common setting here.

{    "go.buildOnSave": "off",    "go.lintOnSave": "package",    "go.vetOnSave": "off",    "go.buildFlags": [],    "go.lintFlags": [],    "go.vetFlags": [],    "go.lintTool": "golint",    "go.coverOnSave": false,    "go.testOnSave" : false,    "go.useCodeSnippetsOnFunctionSuggest": false,    "go.formatTool": "gofmt",    "[go]": {         "editor.formatOnSave": true,         "editor.insertSpaces": true,         "editor.tabSize": 2,         "editor.detectIndentation": false,         "files.eol": "\n",         "files.insertFinalNewline": true,    }}

Best thing about GO in VSCode is that Google has developed a very rich-featured extensions that cover a lot of ground. Two of the requirements from the lab require the students to write a one-step command line solution to format and lint the project. Thanks to the VSCode GO extension, these two are built in. You can simply run at the root directory go fmt ./... to format and golint ./... to lint the whole project. This feature made me enjoy my decision to code this project in GO more and more because it helps me to save a lot of time. When I run these two commands, not much changes in my codes because they are built in so they run by default when I save.

I then squashed all my commits into a single commit with all the changes and update my master repo. It was a quick lab, I just needed to closely follow the instructions.

Thank you for reading.

Tony Vu.

--

--

No responses yet