Fareez Ahamed

Tag: Go (3)

Why Interfaces in Go Are Not Explicitly Implemented

Aug 2, 2021

Languages that came after Java, had great influence of it irrespective of static-typed or dynamic—especially the Object-Oriented features. Interfaces, popularized by Java was taken straight into other languages like C# and even dynamically typed languages like PHP! But Go has questioned every existing solution thoroughly before inheriting those features. No while loops, no do-while loops, no ternary operators, no constructors, nothing was brought in Go just because it existed earlier.

Read more...

Embedding a React Application in Go Binary

Mar 22, 2021

Go 1.16 has come out with a feature which I waited for quite some time. With Embed we will be able to add static files into the go binary at build time. It also makes accessing the files as simple as dealing with File System APIs.

Read more...

Thread Safe Lazy Loading Using sync.Once in Go

Jan 19, 2021

Imagine you have a server and you are loading some configuration for executing some business logic. You don’t want to load all the configuration when the server is launched since it will take a lot of time for it to be ready for handling requests. You have to postpone loading configuration till it is actually needed. It’s called Lazy Loading.

Read more...