Welcome To Golang By Example

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

Category: Tech

Allowed key and value types for a map in Go (Golang)

Posted on June 20, 2020June 20, 2020 by admin

Maps are golang builtin datatype similar to the hash table which maps a key to a value. . Below is the format for a map: Both key_type and value_type can be of…

Update a key in the map in Go (Golang)

Posted on June 20, 2020June 20, 2020 by admin

When trying to add a key to the map which already exists, the new value will override the old value. This is analogous to updating a key in the map. Let’s see…

Iterate over a string in Go (Golang)

Posted on June 20, 2020June 20, 2020 by admin

In Golang string is a sequence of bytes. A string literal actually represents a UTF-8 sequence of bytes. In UTF-8, ASCII characters are single-byte corresponding to the first 128 Unicode characters. All other…

Length of string in Go (Golang)

Posted on June 20, 2020April 6, 2021 by admin

In Golang string is a sequence of bytes. A string literal actually represents a UTF-8 sequence of bytes. In UTF-8, ASCII characters are single-byte corresponding to the first 128 Unicode characters. All other…

Declare/Initialize/Create an array or slice in Go (Golang)

Posted on June 20, 2020January 8, 2021 by admin

Overview Similar to any other programming language, golang also has an array data structure. But in go, arrays behave little differently than other languages and also we have something called slice in…

Pointer Receiver for a method in Go (Golang)

Posted on June 20, 2020June 20, 2020 by admin

To better understand pointer receiver we first have to understand the value receiver for a method. Methods on Value Receiver Let’s see an example of a value receiver Output Notice that the…

Method in Go (Golang)

Posted on June 20, 2020November 26, 2020 by admin

This is the  chapter 20 of the golang comprehensive tutorial series. Refer to this link for other chapters of the series – Golang Comprehensive Tutorial Series Next Tutorial – InterfacePrevious Tutorial – Maps Now let’s check…

Method Chaining in Go (Golang)

Posted on June 20, 2020June 20, 2020 by admin

For method chaining to be possible, the methods in the chain should return the receiver. Returning the receiver for the last method in the chain is optional. Let’s see an example of…

Method on a non-struct type in Go (Golang)

Posted on June 20, 2020June 20, 2020 by admin

Methods can also be defined on a non-struct custom type. Non-struct custom types can be created through type definition. Below is the format for creating a new custom type For example we…

Struct Field Meta or Tags in Go (Golang)

Posted on June 14, 2020June 14, 2020 by admin

A struct in go also allows adding metadata to its fields. These meta fields can be used to encode decode into different forms, doing some forms of validations on struct fields, etc….

Posts pagination

Previous 1 … 37 38 39 … 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