golang
I am late to golang game, but better late than never.
I’ve been using python for all my programming needs and never felt much need to explore other language. Reason for sticking with python,
- Easy to build stuff, unless you are building something for very high throughput.
- Easy for others to contribute. Most of the people I worked with were familiar with Python.
easy is the keyword.
First impressions on go
I wish I had started on go earlier. I almost forgot using a statically typed language. I think last time I’ve used it was when I was in college(c++ yay!). Requirement for writing c++ never came in and I never put that much interest in continuing my C++ practice.
golang is a staticly typed language. This means that you would need to declare variable before using them. This have lot of advantages in the compiler world, as compiler will be able to detect problems with types during the compile time, something you don’t have in dynamically typed language.
golang is a compiled language. This means that golang will be converted into assembly language for running. This gives you benefit of fast execution and the executable can be run without any dependencies.
Editor
Most of my python work was done in PyCharm or Sublime. I’ve decided to explore another IDE which can give a common ground for both Python and golang. Thats when I found Visual Studio Code. I found it very useful, although you would need to install couple of extensions for support of golang and python. I highly recomend going through their walkthroughs, adds speed to the whole process.
Workspace
As the name indicates, its the place to keep go code. Two directories can seen in root,
src
- this is where you keep your go source code.bin
- this is where the binary gets generated after the program compiles.
Interesting thing is src
can contain different repositories and not just one.
GOPATH
This specifies your workspace. This comes into play when you install third party applications, usually using go get
.
You can set it as env variable export GOPATH=/path-to-go-dir/
. You can check the path using go env GOPATH
.
Thats it for now. I will keep adding more points as I go along go.
golang docs are pretty solid and helps you start off. Adding some resources that I found useful.