This repository contains an educational project to learn the Go programming language. It is designed to help you learn various Go concepts practically, with hands-on examples. The project is divided into 22 sections, each focusing on different topics and use cases in Go.
In this project, you will find the following topics:
- 01_function - Introduction to defining and using functions in Go.
- 02_if&else&switch_Case - Using conditional statements like
if
,else
, andswitch case
. - 03_forLoop - Using
for
loops to perform repeated operations. - 04_String - Working with strings in Go.
- 05_Array&slices - Using arrays and slices.
- 06_maps - Introduction to maps and how to use them for storing data.
- 07_functions - Advanced function usage and passing parameters.
- 08_parameters - Handling function input and output parameters.
- 09_errors - Managing and handling errors.
- 10_defer - Using the
defer
statement for cleanup operations. - 11_structs - Defining and using
structs
to model data. - 12_methods - Defining methods for data types.
- 13_new_struct_with_func - Creating new
struct
instances using functions. - 14_panic_recover - Managing critical situations with
panic
and recovering withrecover
. - 15_goroutines - Introduction to goroutines for concurrent execution.
- 16_channels - Communicating and coordinating between goroutines using channels.
- 17_select - Using
select
to handle multiple channels simultaneously. - 18_import - Managing imports and packages.
- 19_testing - Writing tests for Go code.
- 20_JSON - Working with JSON data.
- 21_HTTP - Using HTTP protocol to make requests.
- 22_HTTP_server - Implementing a simple HTTP server.
- **23_new_Project
This project is designed so that you can run each section independently to learn different concepts. Files are organized in a way that progresses from simpler to more advanced concepts.
To run this project, you need to have Go installed. Follow the steps below to install Go and run the project:
- Install Go.
- Clone the project:
git clone https://github.com/javadkavossi/GoLang_learning.git
cd GoLang_learning
go run main.go
//go run folderName/main.go
Javad Kavossi - Developer and creator of this educational project.