Awesome Golang tricks I wish I knew earlier

Manpreet Singh
3 min readJun 23, 2022

Welcome back! Golang is an awesome programming language with a ton of capability, if you’re new to Golang, check out the link below to learn more about it:

So, let’s take a look at some awesome Golang tricks I wish I had known about earlier!

Import Packages Differently

Within Go you can actually import packages a few different ways, if you want to import a package and create an alias, you can import it with a different name like this:

import buf "bufio"

You can also import a package like this:

import . "bufio"

You can also import a package like this:

import _ "bufio"

Those are just a few different ways to import a package within Go

Machine Learning With Go

Did you know Go has a ton of machine learning packages out for it? Well, there actually are! Here are just a few of the packages available for this language:

--

--