Lessons
Go Introduction
Go Get Started
Go Syntax
Go Comments
Go Variables
- Declare Variables
- Go में Variables का परिचय
- Go में Multiple Variable Declaration
- Variable Naming Rules (नामकरण के नियम)
Go Constants
Go Output
Go Data Types
- Basic Data Types
- Go Boolean Data Type (बूलियन डेटा प्रकार)
- Go Integer Data Types
- Go Float Data Types
- Go String Data Type
Go Arrays
Go Slices
Go Operators
- Go Operators
- Arithmetic Operators
- Assignment Operators
- Comparison Operators
- Logical Operators
- Bitwise Operators
Go Conditions
Go Switch
Go Loops
Go Functions
Go Struct
Go Maps
Project Structure
Go Introduction
What is Go?
- Go is a cross-platform, open source programming language
- Go can be used to create high-performance applications
- Go is a fast, statically typed, compiled language known for its simplicity and efficiency
- Go was developed at Google by Robert Griesemer, Rob Pike, and Ken Thompson in 2007
- Go's syntax is similar to C++
What is Go Used For?
- Web development (server-side)
- Developing network-based programs
- Developing cross-platform enterprise applications
- Cloud-native development
Why Use Go?
- Go is fun and easy to learn
- Go has fast run time and compilation time
- Go supports concurrency
- Go has memory management
- Go works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc.)
Go Compared to Python and C++
| Go | Python | C++ |
|---|---|---|
| Statically typed | Dynamically typed | Statically typed |
| Fast run time | Slow run time | Fast run time |
| Compiled | Interpreted | Compiled |
| Fast compile time | Interpreted | Slow compile time |
| Supports concurrency through goroutines and channel | No built-in concurrency mechanism | Supports concurrency through threads |
| Has automatic garbage collection | Has automatic garbage collection | Does not have automatic garbage collection |
| Does not support classes and objects | Has classes and objects | Has classes and objects |
| Does not support inheritance | Supports inheritance | Supports inheritance |
Notes:
- Compilation time refers to translating the code into an executable program
- Concurrency is performing multiple things out-of-order, or at the same time, without affecting the final outcome
- Statically typed means that the variable types are known at compile time