Golang ProgramsGolang Programs

Golang Examples and Solutions

  1. How to find the type of the variable by different ways in Golang?

  2. How to get first and last element of slice in Golang?

  3. How can I convert a string variable into Boolean, Integer or Float type in Golang?

  4. How to fetch an Integer variable as String in Go?

  5. How to concatenate two or more slices in Golang?

  6. How do you write multi-line strings in Go?

  7. Various examples of printing and formatting in Golang

  8. Example of Sscan vs Sscanf vs Sscanln from FMT Package

  9. Example of Fscan, Fscanf, and Fscanln from FMT Package

  10. Example: How to use ReadAtLeast from IO Package in Golang?

  11. Example: How to use ReadFull from IO Package in Golang?

  12. Example: How to use TeeReader from IO Package in Golang?

  13. Example: ReadAll, ReadDir, and ReadFile from IO Package

  14. How to read/write from/to file in Golang?

  15. How to append text to a file in Golang?

  16. How to update content of a text file?

  17. How to use for and foreach loop?

  18. How to check if a map contains a key in Go?

  19. How to get struct variable information using reflect package?

  20. How to read names of all files and folders in current directory?

  21. How to read current directory using Readdir?

  22. How to read input from console line?

  23. Constructors in Golang

  24. Different ways to convert Byte Array into String

  25. What is Rune? How to get ASCII value of any character in Go?