×

Golang Tutorial

Golang Reference

Golang Programs

Golang Practice

Golang Miscellaneous

Golang Programs

The Go programming language (often referred to as Golang) is an open-source, expressive, concise, clean, and efficient programming language to make programmers more productive. It was developed by Robert Griesemer, Rob Pike, and Ken Thompson, and launched in 2009 by Google as an open-source project.

Golang programs / examples: This section contains solved Golang programs/examples on the various topics such as basic programs, conditions & control statement-based programs, looping programs, array & string programs, structure programs, function & package-based programs, etc. with examinations and outputs.

Golang Programs Index



Golang Basic Programs

  1. Golang program to print Hello World
  2. Golang program to add two integer numbers
  3. Golang program to find the average of three numbers
  4. Golang program to swap two integer numbers
  5. Golang program to read and print an integer variable
  6. More Golang Basic Programs ...

Golang Switch Statement Programs

  1. Golang program to demonstrate the switch case with optional statement and expression
  2. Golang program to demonstrate the switch case without optional statement and expression
  3. Golang program to demonstrate the switch case with expression
  4. Golang program to use the expression in the case statement
  5. Golang program to create a simple calculator using switch case
  6. More Golang Switch Statement Programs ...

Golang goto Statement Programs

  1. Golang program to print 'Hello World' 5 times using the goto statement
  2. Golang program to print the table of the given number using the goto statement
  3. Golang program to read the name and print it 5 times using the goto statement
  4. Golang program to print the Hex value of numbers from 1 to 100 using the goto statement
  5. Golang program to print the Octal value of numbers from 1 to 100 using the goto statement
  6. More Golang goto Statement Programs ...

Golang Looping Programs

  1. Golang program to calculate the Highest Common Factor (HCF)
  2. Golang program to calculate the multiplication of two numbers using the '+' operator
  3. Golang program to print table of a given number using for loop
  4. Golang program to print the tables up to given number using for loop
  5. Golang program to calculate the factorial of given number using for loop
  6. More Golang Looping Programs ...

Golang Array Programs

  1. Golang program to demonstrate the example of an Array
  2. Golang program to demonstrate the shorthand declaration of an Array
  3. Golang program to create an array without specifying its size
  4. Golang program to get the size of the array
  5. Golang program to print the array elements without using the loop
  6. More Golang Array Programs ...

Golang String Programs

  1. Golang program to check a string contains a specified substring
  2. Golang program to convert specified string in uppercase
  3. Golang program to convert specified string in lowercase
  4. Golang program to get the index of a specified character in the string
  5. Golang program to get the length of the specified string
  6. More Golang String Programs ...

Golang Structure Programs

  1. Golang program to demonstrate the implementation of structure
  2. Golang program to initialize the object of structure in a single line
  3. Golang program to print the object of structure
  4. Golang program to get the size of structure using Sizeof() operator
  5. Golang program to demonstrate the array of the structure
  6. More Golang Structure Programs ...

Golang User-defined Function Programs

  1. Golang program to create a user-defined function
  2. Golang program to create a user-defined function to add two integer numbers
  3. Golang program to demonstrate the call by value mechanism in a user-defined function
  4. Golang program to demonstrate the call by reference mechanism in a user-defined function
  5. Golang program to pass an array in a user-defined function
  6. More Golang User-defined Function Programs ....

Golang Variadic Function Programs

  1. Golang program to demonstrate the variadic function
  2. Golang program to create a function with the variable number of arguments to calculate the sum of all arguments
  3. Golang program to pass a slice of integers in a variadic function
  4. More Golang Variadic Function Programs ...

Golang Recursion Programs

  1. Golang program to demonstrate the recursion
  2. Golang program to calculate the factorial using recursion
  3. Golang program to print the Fibonacci series using recursion
  4. Golang program to calculate the power of a given number using recursion
  5. Golang program to count digits of given number using recursion
  6. More Golang Recursion Programs ...

Golang Pointer Programs

  1. Golang program to demonstrate the pointer
  2. Golang program to demonstrate the pointer to pointer
  3. Golang program to demonstrate the float pointer
  4. Golang program to demonstrate pointer to an array
  5. Golang program to demonstrate pointer to an array as a function argument
  6. More Golang Pointer Programs ...

Golang Conversion Programs

  1. Golang program to convert a numerical string into an integer number
  2. Golang program to convert the string into float number using ParseFloat() function
  3. Golang program to convert a float number into an integer number
  4. Golang program to convert 64-bit float number into 32-bit float number
  5. Golang program to convert 64-bit integer number into a 32-bit integer number
  6. More Golang Conversion Programs ...

Golang Slices Programs

  1. Golang program to create a slice from an integer array
  2. Golang program to find the length of a slice
  3. Golang program to find the capacity of a slice
  4. Golang program to demonstrate the different ways to create slices
  5. Golang program to create a new slice from the existing slice
  6. More Golang Slices Programs ...

Golang Date & Time Programs

  1. Golang program to get current date and time
  2. Golang program to print current date-time in different formats using Format() function
  3. Golang program to get the date, month, year in different variables using Date() function
  4. Golang program to print date and time in different formats using format constants
  5. Golang program to print individual elements of date and time using the inbuilt function
  6. More Golang Date & Time Programs ...

Golang Timers & Tickers Programs

  1. Golang program to implement the ticker for every second
  2. Golang program to implement the multiple tickers
  3. Golang program to print the received value from the ticker
  4. Golang program to implement a global ticker
  5. Golang program to perform some other activities with the ticker
  6. Golang Timers & Tickers Programs

Golang Goroutines Programs

  1. Go program to demonstrate a simple Goroutine
  2. Go program to call a Goroutine with another normal function concurrently
  3. Go program to create an anonymous Goroutine
  4. Go program to demonstrate the multiple Goroutines
  5. More Golang Goroutines Programs ...

Golang Reflection Programs

  1. Golang program to get the type of specified variable
  2. Golang program to demonstrate the reflect.NumField() function
  3. Golang program to demonstrate the use of fallthrough keyword
  4. Golang program to demonstrate the errors.New() function
  5. More Golang Reflection Programs ...

Golang Maps Programs

  1. Golang program to create a simple map
  2. Golang program to delete an item from a map
  3. Golang program to count the items of a map
  4. Golang program to create a copy of the map
  5. Golang program to iterate map elements using the range
  6. More Golang Maps Programs ...

Golang Range Programs

  1. Golang program to iterate different types of data structures using the range
  2. More Golang Range Programs ...

Golang Channels Programs

  1. Golang program to create a simple channel
  2. Golang program to create the buffered channel
  3. Golang program to pass buffered channel into a user-defined function
  4. Golang program to receive items from a channel using the loop
  5. Golang program to create the unidirectional channel
  6. More Golang Channels Programs ...

Golang File Handling Programs

  1. Golang program to create a text file
  2. Golang program to write and read data from a text file
  3. Golang program to create an empty file
  4. Golang program to get the size of an existing file in bytes
  5. Golang program to print the permissions of the existing file
  6. More Golang File Handling Programs ...

Golang Buffered Input-Output Programs

  1. Golang program to write data into the file using buffer writer
  2. Golang program to get the buffered size using buffer writer
  3. Golang program to get the available buffer size of buffer writer
  4. Golang program to reset the buffer writer
  5. Golang program to get the default buffer writer size
  6. More Golang Buffered Input-Output Programs ...

Golang Command-Line Arguments Programs

  1. Golang program to demonstrate the command line arguments
  2. Golang program to find the count of command-line arguments
  3. Golang program to parse a command line flag of string type
  4. Golang program to parse a command line flag of integer type
  5. Golang program to parse multiple command-line flags
  6. More Golang Command-Line Arguments Programs ...

Golang Regular Expressions Programs

  1. Golang program to check a specified string is started with a given character using regular expression
  2. Golang program to check a specified string pattern within a specified string using regular expression
  3. Golang program to demonstrate the regular expression function FindString()
  4. Golang program to demonstrate the regular expression function FindStringIndex()
  5. Golang program to demonstrate the regular expression function FindStringSubmatch()
  6. More Golang Regular Expressions Programs ...

Golang JSON Programs

  1. Golang program to encode Boolean, integer, and float data using json.Marshal() function
  2. Golang program to encode a string array using json.Marshal() function
  3. Golang program to encode a map using json.Marshal() function
  4. Golang program to encode a structure using json.Marshal() function
  5. Golang program to decode a JSON string using Unmarshal() function
  6. More Golang JSON Programs ...

Golang os Package Programs

  1. Golang program to get the hostname of the computer
  2. Golang program to demonstrate the os.Exit() function
  3. Golang program to get path separator using os.PathSeparator constant
  4. Golang program to get the null device
  5. Golang program to print environment detail
  6. More Golang os Package Programs ...

Golang strconv Package Programs

  1. Golang program to convert a specified numeric string into integer using strconv.Atoi() function
  2. Golang program to convert a specified integer number to a numeric string using strconv.Itoa() function
  3. Golang program to convert a specified string into Boolean value
  4. Golang program to convert a Boolean value to string
  5. Golang program to convert a signed integer value to a hexadecimal string
  6. More Golang strconv Package Programs...

Golang log Package Programs

  1. Golang program to demonstrate the log.Print() function
  2. Golang program to demonstrate the log.Printf() function
  3. Golang program to demonstrate the log.Fatal() function
  4. Golang program to demonstrate the log.Fatalf() function
  5. Golang program to demonstrate the log.Panic() function
  6. More Golang log Package Programs ...

Golang math/rand Package Programs

  1. Golang program to demonstrate the rand.Intn() function
  2. Golang program to demonstrate the rand.Seed() function
  3. Golang program to generate the slice of random numbers
  4. Golang program to shuffle words of a string
  5. Golang program to generate the random number of integer types
  6. More Golang math/rand Package Programs ...

Golang math/bits Package Programs

  1. Golang program to print the number of leading zeros in an 8-bit binary number
  2. Golang program to print the number of leading zeros in a 32-bit binary number
  3. Golang program to print the number of leading zeros in a 64-bit binary number
  4. Golang program to print the minimum number of bits required to represent a number
  5. Golang program to print the minimum number of bits required to represent an 8, 16, 32, 64 bits number
  6. More Golang math/bits Package Programs ...

Golang sync/atomic Package Programs

  1. Golang program to add value to a 32-bit integer in an uninterruptible manner
  2. Golang program to add value to a 64-bit integer in an uninterruptible manner
  3. Golang program to add value to a 32-bit unsigned integer in an uninterruptible manner
  4. Golang program to add value to a 64-bit unsigned integer in an uninterruptible manner
  5. Golang program to add value to a uintprt variable in an uninterruptible manner
  6. More Golang sync/atomic Package Programs ...

Golang path/filepath Package Programs

  1. How to split the path into a list of individual paths in Golang?
  2. How to get the absolute path from a relative path in Golang?
  3. How to get the directory name from a path in Golang?
  4. How to get the file name extension used by path in Golang?
  5. More Golang path/filepath Package Programs ...

Golang syscall Package Programs

Golang Signals Programs

  1. Golang program to demonstrate the SIGINT signal
  2. Golang program to handle different types of signals
  3. More Golang Signals Programs ...

Golang Shell Script Programs

  1. Golang program to check specified shell command exists or not
  2. Golang program to execute a specified shell command without options
  3. Golang program to execute a specified shell command with specified option
  4. Golang program to execute a specified shell command with multiple options
  5. Golang program to execute the specified shell script
  6. More Golang Shell Script Programs ...

Golang Miscellaneous Programs

  1. Finding the Square Root of the Complex Number in Golang
  2. Golang program to demonstrate the panic() function
  3. Golang program to terminate the program with a specified exit code
  4. Golang program to recover program after panic condition
  5. Golang program to print the current user id
  6. Golang program to print the group id of the current process



Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.