MCPcopy Create free account

hub / github.com/Hardik180704/Go / types & classes

Types & classes17 in github.com/Hardik180704/Go

TypeAliasAge
Custom type based on int (works because of ~int)
Generics/main.go:127
StructBankAccount
============================================ REAL-WORLD EXAMPLE: Bank Account ============================================
Mutex/main.go:221
StructContainer
Container is a GENERIC STRUCT [T any] means the struct can hold any type Real-world example: Like a box that can hold toys, books, or clothes
Generics/main.go:64
StructEmail
============================================ CHANNELS: Communication between goroutines ============================================ Channels are like
Channels/main.go:43
StructEmployee
nested structs
Structs/main.go:45
StructManager
Struct embedding and methods
Structs/main.go:69
InterfaceNumber
sumNumbers uses CONSTRAINT INTERFACE with ~ ~int means "any type whose underlying type is int" This includes: int, type MyInt int, type Age int, etc.
Generics/main.go:49
TypeAliasOrderStatus
OrderStatus is a custom type based on string This creates a "type-safe enum" pattern in Go Type-safe means you can't accidentally use a random string
Enums/main.go:9
StructPerson
Structs -> custom data types defining a struct
Structs/main.go:7
StructUser
Packages/user/user.go:3
Structpayment
payment struct holds a payment gateway The 'gateway' field can be ANY type that implements the paymenter interface This is the power of interfaces - y
Interfaces/main.go:15
Interfacepaymenter
paymenter is an interface that defines a contract Any type that wants to be a "paymenter" MUST implement the pay() method This is like a rule book - "
Interfaces/main.go:8
StructpostRWMutex
============================================ RWMUTEX: Read-Write Mutex 📖✍️ ============================================ Problem with regular Mutex: Re
Mutex/main.go:99
StructpostSafe
============================================ SOLUTION: Using Mutex ============================================
Mutex/main.go:48
StructpostUnsafe
============================================ MUTEX: Mutual Exclusion Lock 🔒 ============================================ MUTEX stands for "MUTual EXcl
Mutex/main.go:30
Structrazorpay
razorpay is an empty struct representing the Razorpay payment gateway
Interfaces/main.go:29
Structstripe
stripe is another payment gateway
Interfaces/main.go:39