Welcome To Golang By Example

Menu
  • Home
  • Blog
  • Contact Us
  • Support this website
Menu

Category: Tech

Difference between GRPC and Rest

Posted on March 23, 2021March 23, 2021 by admin

Overview REST is an architectural style built on top of HTTP/1. GRPC is not a style instead it is an RPC framework built on top of HTTP/2 and it uses protocol buffers…

How to initialize a struct having an array or slice field in Go (Golang)

Posted on March 4, 2021March 4, 2021 by admin

Overview A struct can have a field which is a slice or array of another type. To initialize such a struct we can initialize the slice/array of another type first. After that, we…

How to intialize a struct that has another nested struct in Go (Golang)

Posted on March 4, 2021March 4, 2021 by admin

Overview A struct can have another struct nested in it. Let’s see an example of a nested struct. In below example employee struct has the address struct nested it in. To initialize such kind of struct…

HTTP Client to not follow redirect in Go (Golang)

Posted on March 3, 2021March 3, 2021 by admin

Overview http.Client struct is used to make HTTP requests in golang. https://golang.org/src/net/http/client.go http.Client lets you specify a policy of how redirects can be handled.  Below is the structure of http.Client struct The…

Validate the range of the integer in an HTTP request body in Go (Golang)

Posted on March 2, 2021March 2, 2021 by admin

Overview The below library can be used to validate the range of an integer in an incoming JSON HTTP request body gopkg.in/go-playground/validator.v9 – https://pkg.go.dev/github.com/go-playground/validator For this tutorial, we will try to parse…

Validate the range of the integer in a struct in Go (Golang)

Posted on February 27, 2021February 27, 2021 by admin

Overview The below library can be used to validate the range of an integer in a struct in Golang gopkg.in/go-playground/validator.v9 – https://pkg.go.dev/github.com/go-playground/validator For this tutorial, we will use the below employee struct…

Validate the presence of the field in a struct in Go (Golang)

Posted on February 27, 2021February 27, 2021 by admin

Overview In this tutorial, we will explore two libraries that can be used to validate the field of a struct in Golang. The two libraries are gopkg.in/go-playground/validator.v9 – https://pkg.go.dev/github.com/go-playground/validator github.com/asaskevich/govalidator – https://github.com/asaskevich/govalidator…

Set a timeout while making an HTTP request in Go (Golang)

Posted on February 20, 2021February 20, 2021 by admin

Overview client struct of HTTP package can be used to specify the timeout. While creating the HTTP client we can specify the value of the Timeout. An important thing to note about…

ASCII digit to the character in Go (Golang)

Posted on February 20, 2021February 20, 2021 by admin

Overview Below is the simple program to convert an ASCII digit to its corresponding character in go. We can simply typecast the number to the string. That will convert it into its…

HTTP- Understanding multipart/form-data content-type

Posted on January 19, 2021January 19, 2021 by admin

In HTTP context, the multipart/form-data content-type is used for submitting HTML form. In the case of multipart/form-data, as the name suggests the body consists of different parts separated by a delimiter or…

Posts pagination

Previous 1 … 21 22 23 … 62 Next
Follow @golangbyexample

Popular Articles

Golang Comprehensive Tutorial Series

All Design Patterns in Go (Golang)

Slice in golang

Variables in Go (Golang) – Complete Guide

OOP: Inheritance in GOLANG complete guide

Using Context Package in GO (Golang) – Complete Guide

All data types in Golang with examples

Understanding time and date in Go (Golang) – Complete Guide

©2025 Welcome To Golang By Example | Design: Newspaperly WordPress Theme