Go If Statement

Every If statement in Go programming contains a condition or expression followed by a list of code lines. If the condition result is true, then that blocks of code will run. And if the condition results false, it will exit from the if statement. The If statement Syntax if expression { block1 } Go If … Read more

Golang Switch Case

Golang Switch Case 1

The Golang switch statement starts with the switch keyword followed by the expression and then cases. While working with many conditions, it is tedious to work with the Else If statement. In such cases, we can use this Go switch statement and write as many cases as you want. In the Go switch statement, each … Read more

Go Comments

Go Comments 1

Go programming supports two kinds of comments. The single-line comment will start with //, and the general or multiple line comments begin with /* and end with */. The following golang example shows you the single and multi-line comments in a real-time example. package main import “fmt” func main() { var x string = “Hello … Read more

Go Constants

Golang Constant 3

Constants in Go programming are the variable whose values remain fixed. Once we declared a constant variable and assigned a value, we later cannot change its value. In Golang Programming, we can declare a constant variable using the const keyword. For instance,  const info string = “Welcome to Go Tutorial” If you observe the constant … Read more