When it comes to creating a production-grade application, using the environment variable in the application is de facto.
Need of the environment variable?
Suppose you have an application with many features and each feature need to access the Database. You configured all the DB information like
PASSWORD in each feature
I will talk about the one of major disadvantages of this:
gitthen the details of your DB will go…
When i first started my journey on golang, i could not found an easy way to setup auto reloading. So the issue was every time i make changes to my source code, i had to kill the existing server, restart server again and then test API with postman.
Definitely, this process is cumbersome and headache to do. Whenever we save the code changes, we want our old server process to be killed automatically and start new one with new code changes, so that we can test our changes immediately.
I referred quite a lot of articles but could find proper…
I was very confused at the beginning when I read an article that says “Go is object-oriented”. Sometimes another article claims that no object-oriented programming can be done with Go, only because it does not have any classes. So I am writing this article just to clarify this topic. Is Go object-oriented, or not?
For example, if you come from C, clearly Go has lots more object-oriented programming features. Coming from Java, Go code doesn’t look much object-oriented. …
What is actually a map in Golang?.
There’s no such specific data type in Golang called map; instead, we use the
map keyword to create a map with keys of a certain type and values of another type (or the same type).
The value assigned here is a map literal. It takes the form:
Var menuprice map[string]int
In this example, we declare a map that has
string for its keys, and int for its values.
Golang map key types?? key vs values
What types of keys can a map have? Could we, for example, make…
An anti-pattern is an idea of how not to solve it because implementing that idea would result in bad design.
When you build a web-application, A common scenario is to display a list of items, might be a list of names, a list of products, and soon others.
“Let learn the concept of List Rendering First and issue about index as a key in React”
If you are…
Code executes step by step in order:
SYNCHRONOUS CODE: BLOCKING STATE AND SLOW PERFORMANCE
posts = loadpostsync();
// wait tills posts are fetched
dotheNextthing)(); // has to wait until posts are fetched
Gin is a web framework written in Go (Golang). It features an API with much better performance, up to 40 times faster thanks to the HTTP router. If you need performance and good productivity, you will love to use Gin.
To install the Gin package, you need to install Go and set your Go workspace first.
Download and install it:
$ go get -u github.com/gin-gonic/gin
net/http. This is required for example if using constants such as
2. Create your project folder and
$ mkdir -p $GOPATH/src/github.com/coderDenes/go-gin-api …