Welcome To Golang By Example

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

Tag: golang

Global and Local Constant in Go (Golang)

Posted on September 27, 2020September 27, 2020 by admin

Overview Like any other variable, a constant will be global within a package if it is declared at the top of a file outside the scope of any function. For example, in…

Constant in inner/outer scope in Go (Golang)

Posted on September 27, 2020September 27, 2020 by admin

Overview A constant declared within an inner scope having a same name as constant declared in the outer scope will shadow the constant in outer scope. Example Output The above program prints…

Can constant be reassigned after its declaration in Go (Golang)

Posted on September 26, 2020September 26, 2020 by admin

Overview Constant Variable cannot be reassigned after its declaration as it is constant and its value cannot change. If you try to reassign to a constant variable then it will raise a…

Constant in Go (Golang)

Posted on September 25, 2020November 25, 2020 by admin

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

Create panic by calling panic function in Go (Golang)

Posted on September 23, 2020September 23, 2020 by admin

Overview Go provides a special function to create a panic. Below is the syntax of the function This function can be called explicitly by the programmer to create a panic. It takes…

Can defer be used inside main function in Go (Golang)

Posted on September 23, 2020September 23, 2020 by admin

Overview Defer as the name suggests is used to defer the cleanup activities in a function. These cleanup activities will be performed at the end of the function. defer can be used…

Defer and Methods in Go (Golang)

Posted on September 23, 2020September 23, 2020 by admin

Overview defer statement is also applicable  for methods in a similar way it is applicable to functions. Let’s see an example Example In the above program, we do defer file.Close() after opening…

Defer function and Named Return Values in Go (Golang)

Posted on September 22, 2020September 22, 2020 by admin

Overview In case of named return value in the function, the defer function can read as well as modified those named return values. If the defer function modifies the name return value…

Multiple defer functions in Go (Golang)

Posted on September 22, 2020September 22, 2020 by admin

Overview There can be two cases of multiple defer functions Multiple Defer function within a particular function Multiple Defer function in different functions Before we see an example for both let’s see…

What happens during panic in Go (Golang)

Posted on September 22, 2020September 22, 2020 by admin

Overview Let’s understand what happens when panic happens in a program. Imagine a function call from main function to f1 function to f2 function main->f1->f2 Now let’s say that panic happens in…

Posts pagination

Previous 1 … 23 24 25 … 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