Welcome To Golang By Example

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

Tag: golang

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…

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…

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….

Accessing and Setting Struct Fields in Go (Golang)

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

Overview GO struct is named collection of data fields which can be of different types. Struct acts as a container that has different heterogeneous data types which together represents an entity. For…

Nested Struct in Go (Golang)

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

A struct can have an another struct nested in it. Let’s see an example of a nested struct. In below employee struct has address struct nested it in. Output Notice how nested…

Anonymous Fields in a Struct in Go (Golang)

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

A struct can have anonymous fields as well, meaning a field having no name. The type will become the field name. In below example, string will be the field name as well The…

Posts pagination

Previous 1 … 30 31 32 … 41 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