A high-performance HTTP website with templates in GoLang

Muhammet Arslan
Muhammet Arslan
Published in
4 min readDec 13, 2019

--

There are tens of web frameworks, was developed with GoLang and provides you to create web services easily. But for me, there is no need to use a framework with GoLang. GoLang provides everything which you need to build services and it’s much easier to import whichever library you need.

Let’s start;

Logger

Logging is important and you have to be careful while implementing a logger. GoLang log library doesn’t perform well as Uber's Zap Library.

I’ve modified the development logger a bit to implement some colors and time encoding as well. Sample implementation;

logger := logger.New("MuhammetArslan", "development")logger.Debug("Debug! This will not be seen if environment is 'production'")
logger.Error("Error Test")
logger.Warn("Warn Test")
logger.DPanic("DPanic Test")
logger.Fatal("Fatal Test")

I’ve implemented the Name parameter to split logs easily on the console. For different components, I’m labeling a new Name. So the output…

--

--