Learn to code in Python, C/C++, Java, and other popular programming languages with our easy to follow tutorials, examples, online compiler and references.
The user friendly C# online compiler that allows you to write C# code and run it online. The C# text editor also supports taking input from the user and standard libraries. It uses the mono compiler to compile code.
Type Casting allows us to convert the value of one data type to another. In this tutorial, you'll learn about type casting in Go with the help of examples.
Struct allows us to store variables of multiple data types together. In Go programming, a struct is used to store variables of different data types. For example, Suppose we want to store the name and age of a person. We can create two variables: name and age and store value. However, suppose we want to store the same information of multiple people. In this case, creating variables for a person might be a tedious task. We can create a struct that stores the name and age to overcome this. And, we can use thi
String is a collection of characters, for example "Programiz", "Golang", etc. A string is a sequence of characters. For example, "Golang" is a string that includes characters: G, o, l, a, n, g. We use double quotes to represent strings in Go. For example, // using var var name1 = "Go Programming" // using shorthand notation name2 := "Go Programming" Here, both name1 and name2 are strings with the value "Go Programming".
We use Go functions to divide our code into smaller chunks to make our code looks clean and easier to understand. In this tutorial, you'll learn about the working of functions in Go with the help of examples.
Go closure is a nested function that allows us to access the variables of the outer function even after the outer function is closed. Go closure is a nested function that allows us to access variables of the outer function even after the outer function is closed. Before we learn about closure, let's first revise the following concepts: Nested Functions Returning a function Nested function in Golang In Go, we can create a function inside another function. This is known as a nested function. For example,
Go is an open-source language developed by Google. In this tutorial, we will learn how to get started with Go programming and write our first Go program.
An operator is a symbol that performs operations on a value or a variable. In this tutorial, you will learn about different operators in Go programming with the help of examples.
The if statement is used to create decision-making programs that run a block of code under certain condition. In this tutorial, we will learn about the Golang if...else statement with the help of examples.
A variable scope specifies the region where we can access a variable. In this tutorial, you'll learn about local and global variable scope in Go with the help of examples.
In programming, recursion allows us to create a function that calls itself. In computer programming, a recursive function calls itself. For example, func recurse() { … … … … recurse() } Here, the recurse() function includes the function call within its body. Hence, it is a Go recursive function and this technique is called recursion. Before you learn about recursion, make sure to know Go Functions.
An anonymous function is a function without a name. In Go, we can create a function without the function name, known as an anonymous function. For example, func () { fmt.Println("Function without name") } The above function is a valid function that prints "Function without name". It works just like a regular function in Go. Working of Go Anonymous Function Since an anonymous function doesn't have any name, you might be wondering how we can call the function.
A package is a container that contains various functions to perform specific tasks. In this tutorial, you'll learn about Go packages with the help of examples.
Unlike interfaces, the empty interface in Go doesn't have any method signatures. In this tutorial, you will learn about empty interfaces with the help of examples.
Pointers are special variables that are used to store addresses rather than values. In this tutorial, we will learn about the pointer variables in Golang with the help of examples.
In Go, we can create a pointer variable that stores the memory address of the struct variable. This tutorial will help you use struct and pointer together with the help of examples.
We use Go interfaces to store a set of methods without implementation. In this tutorial, you will learn about the implementation of interfaces in Golang with the help of examples.
The select statement allows us to execute a channel among many alternatives. In this tutorial, you will learn about Golang select with the help of examples.
Errors in programming terminate the execution of a program immediately. In this tutorial, you will learn about error handling in Go programming with the help of examples.
Go type assertions allow us to access the data and data type of values stored by the interface. In this tutorial, you will learn about type assertions and their uses with the help of examples.
Channels in Go act as a medium for goroutines to communicate with each other. Channels in Go act as a medium for goroutines to communicate with each other. We know that goroutines are used to create concurrent programs. Concurrent programs can run multiple processes at the same time. However, sometimes there might be situations where two or more goroutines need to communicate with one another. In such situations, we use channels that allow goroutines to communicate and share resources with each other.
Go is an open-source programming language developed by Google. It has a wide range of applications like data science, artificial intelligence, network server programming, cloud-based applications, and server-side applications.