- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1082 Articles for Go Programming
![Aman Sharma](https://www.tutorialspoint.com/assets/profiles/502230/profile/60_2055880-1660630704.jpg)
1K+ Views
This tutorial will teach us how to create a function without arguments and with a return value. This tutorial involves a gist about the function, and syntax for the function without an argument and with a return type in Golang, then last we will see two different examples of a function without arguments and with a return type. In both examples, we are going to create two functions which are returning a string whenever called. Function without argument and with a return type. SyntaxNow we will see the syntax and explanation for the function without an argument and with a ... Read More
![Aman Sharma](https://www.tutorialspoint.com/assets/profiles/502230/profile/60_2055880-1660630704.jpg)
200 Views
In this tutorial, we are going to see how we can write a simple recursive function Golang with the help of an algorithm and, examples. In the first example, we will print the number from 1 to N in ascending order similarly in the other example we are going to print the number from 1 to N in descending order. In terms of programming, a function is a recursive function if we are calling the function in the same function and have a base condition. Whenever the base condition is satisfied the calling of the function is stopped and we ... Read More
![Aman Sharma](https://www.tutorialspoint.com/assets/profiles/502230/profile/60_2055880-1660630704.jpg)
224 Views
In this tutorial, we will see how to find the Greatest common divisor of two numbers using the Golang language using recursion. We will see two ways to find the GCD of two numbers recursively. First will take more time where we are reducing the minimum of both numbers by 1 and then check if both the numbers are divisible by the min number or not. The second approach will take less time where we are subtracting the larger number from the smaller number until both numbers become equal. Algorithm Step 1 - Declaring the variables to store the ... Read More
![Aman Sharma](https://www.tutorialspoint.com/assets/profiles/502230/profile/60_2055880-1660630704.jpg)
2K+ Views
In this tutorial, we are going to see how we can return multiple values from the function in Golang with the help of an algorithm and examples. Like other programming languages like python, Golang also supports returning multiple values from a function. In the first, example we are going to pass two numbers in the function and return the smaller and then greater number together. In the second example we are passing two numbers and returning the addition, subtraction, multiplication, and division at once. Syntax Func functionName(arguments) (returnType1, returnType2, …) { // logic ... Read More
![Aman Sharma](https://www.tutorialspoint.com/assets/profiles/502230/profile/60_2055880-1660630704.jpg)
505 Views
In this tutorial, we are going to learn how we can find the reverse of the given number in the Golang programming language. The recursive function is more suitable if we want to modify the function that is not possible with a For loop. In this article, we are going to achieve this by using recursion. Explanation Iteration 1: Number = 54678 Reverse of number = 0 Reverse of number = Reverse of number * 10 + Number % 10 = 0 + 54678 % 10 = 0 + 8 = ... Read More
![Aman Sharma](https://www.tutorialspoint.com/assets/profiles/502230/profile/60_2055880-1660630704.jpg)
515 Views
In this tutorial, we are going to find the Least common multiple of two numbers in Golang using recursion. To find the LCM recursively we are going to use the relation of LCM with the Greatest common divisible i.e GCD of both the numbers. LCM stands for least common multiple is the smallest number divisible by two numbers. For example, Suppose the two numbers are 10 and 4. The smallest number that is divisible by both numbers evenly is 20. Finding LCM Using the Relation between LCM and GCD In this example, we are going to find the LCM using ... Read More
![Aman Sharma](https://www.tutorialspoint.com/assets/profiles/502230/profile/60_2055880-1660630704.jpg)
774 Views
In this tutorial, we will learn how to check whether the character is an alphabet or not. This tutorial includes two ways to achieve this − First, using the built-in function isLetter() present in the fmt library will reduce the line of codes. Another way is to use the concept of ASCII values as every character has a unique ASCII value using which we can find out whether the current character is an alphabet or not. The ranges of uppercase and lowercase alphabets are as follows − uppercase alphabets – 65 to 90 lowercase alphabets – 97 to 122 If ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
3K+ Views
In this tutorial, we will write a go language program to push an array to another array. There are many methods for this. The simplest one is to use equality operator. Here, we will see 3 methods via which we can transfer the contents of one array to another in go programming language. Method 1: Push an Array of Strings to an Empty Array by using Equality Operator In this method, we will use equality operator to add the contents of one array to another in the main() section of the program. Note that while transferring elements via this method ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
129 Views
In this tutorial, we will write a go language program to remove the last given number of items from an array. We can do this by either using the inbuilt functions in go or using for loops. The first method is more efficient in functionality than the second one but we will discuss both these methods in this program. Method 1: Remove the Last given Number of Items from an Array of Integers using Append() In this method, we will write a go language program to remove the last given number of items from an array by using the ... Read More
![Akhil Sharma](https://www.tutorialspoint.com/assets/profiles/525598/profile/60_3453735-1664185297.jpg)
2K+ Views
In this tutorial, we will write a go language program to get the first item from an array. An array is a data structure that is used to store elements in contiguous memory locations. Here, we will write two programs to store the first element in the array. In the first program, we will use the concept of indexing and in the second we will use the for loops to get the required result. Method 1: Get the First Item from the Array using Append() Function In this method, we will write a golang program to get the first element ... Read More