Welcome To Golang By Example

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

Category: Tech

Slice or Array of Channels in Go (Golang)

Posted on July 14, 2021July 14, 2021 by admin

Overview It is possible to create a slice or array of channel data type in Golang as well. In fact, a slice or array can be created of any data type in…

Slice of Map in Go (Golang)

Posted on July 14, 2021July 14, 2021 by admin

Overview It is possible to create a slice of map data type in Golang as well. In fact, a slice can be created of any data type in Go. Below is a…

Slice of Struct in Go (Golang)

Posted on July 14, 2021July 14, 2021 by admin

Overview It is possible to create a slice of struct in Golang as well. In fact, a slice can be created of any data type in Go. Below is a simple example…

Append or Add to a Slice or Array in Go (Golang)

Posted on July 12, 2021July 12, 2021 by admin

Overview In golang, the size of the array is part of its type. That is why the length of the array is fixed during creation and cannot be changed later.  This is…

How to check if a map contains a key in Go (Golang)

Posted on July 11, 2021July 12, 2021 by admin

Below is the format to check if a key exists in the map There are two cases If the key exists val variable be the value of the key in the map and ok variable will…

Read a file into a variable in Go (Golang)

Posted on July 11, 2021July 11, 2021 by admin

Overview There are various ways of reading a file into a variable in golang. Here are some of the ways Using ReadFile function provided by the ioutil package Using os.Open and then…

Return an image or file in HTTP response in Go (Golang)

Posted on July 11, 2021July 11, 2021 by admin

Overview Write method of the ResponseWriter interface in net/http package can be used to send the image or file body in an HTTP response body. When we send a file or image…

Return plain text body in HTTP response in Go (Golang)

Posted on July 11, 2021July 11, 2021 by admin

Overview Write method of the ResponseWriter interface in net/http package can be used to set the text/plain body in an HTTP response In GO a response is represented by the ResponseWriter Interface.  Here is…

Return 202 (StatusAccepted) in HTTP response in Go (Golang)

Posted on July 10, 2021July 10, 2021 by admin

Overview net/http package of golang provides the status code constants which could be used to return different status codes- https://golang.org/src/net/http/status.go The same can also be used to return the 202 (StatusAccepted) HTTP…

Return JSON body in HTTP response in Go (Golang)

Posted on July 10, 2021July 11, 2021 by admin

Overview Write method of the ResponseWriter interface in net/http package can be used to set the JSON body in an HTTP response In GO a response is represented by the ResponseWriter Interface.  Here is…

Posts pagination

Previous 1 … 15 16 17 … 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