Member-only story
10x Your Go Development With This Simple Trick
The issue with learning anything new is the same.
You need to put in maximum number of repetitions in minimum amount of time.
You need to keep riding the wave of learning something new, but not beyond the realms of what you can currently achieve knowing what you know now, and at the same time having something to show for it i.e. build something, see something working, see you solving some problem.
One of the key elements to being able to achieve this is to learn to iterate faster.
Ruthlessly cut down on all activities that delay your iterations.
Identify all activities that you need to perform in each iteration and then ideally eliminate that step entirely if possible or optimise it.
While learning Go (Golang), one such activity that takes time is typing the command go run main.go

Sure its just 3 words but having to type it everytime just introduces that slight friction which over time will grind you down and reduce your iterations.
What if you could hit a single key on your keyboard and then it would automatically run your go program?
Using VSCode and a slight adjustment on your macOS, you can achieve this.
First, in VSCode, understand that there is an option under Run called Debugging, which has a F5 shortcut.

What you may not realize is that you can run your go program in its entirety without debugging, just by not setting any breakpoints.
The F5 key in this instance then magically runs your entire go program in a single keystroke.
Slight Problem: MacOS isnt configured by default to help you use the Function keys
To solve this problem, in macOS, go to System Settings > Keyboard > Keyboard Shorcuts.