View Code? Open in Web Editor
NEW
Code examples for Golang students
learning-go's Introduction
- Introduction to Go and its features.
- Installing Go and setting up the development environment.
Basic syntax, data types, and variables.
- Control flow: if-else, switch, loops.
2. Functions and Packages:
- Defining and using functions.
Working with packages and importing them.
- Creating and organizing your own packages.
- Understanding arrays and slices.
- Working with maps (key-value pairs).
- Introduction to structs and methods.
4. Pointers and Memory Management:
- Understanding pointers and memory addresses.
- Pointer operations and memory management.
- Handling errors using the built-in error type.
- Creating custom error types.
- Error handling best practices.
- Goroutines: Introduction to lightweight threads.
- Channels: Communication between goroutines.
- Mutexes: Synchronization and preventing data races.
7. Interfaces and Polymorphism:
- Defining and using interfaces.
- Implementing polymorphism using interfaces.
- Interface composition and empty interfaces.
8. Data Serialization and Deserialization:
- Working with JSON and XML data formats.
- Encoding and decoding data using the encoding/json package.
9. File I/O and Error Handling:
- Reading and writing files.
- Dealing with file-related errors.
- Reflection: Inspecting variables at runtime.
- Context: Managing request-scoped values and deadlines.
- Benchmarking and Profiling:
- Analyzing code performance.
- Building a simple HTTP server.
- Routing with libraries like Gorilla Mux.
- Handling HTTP requests and responses.
12. Database Interaction:
- Connecting to databases using libraries like Gorm or database/sql.
- CRUD operations with databases.
- Writing unit tests with the testing package.
- Table-driven tests and test coverage.
14. Advanced Concurrency Patterns:
- Worker pools and parallel processing.
- Fan-out, Fan-in patterns.
15. Building RESTful APIs:
- Design principles of RESTful APIs.
- Creating APIs using frameworks like Gorilla Mux.
16. Advanced Error Handling:
- Using the errors package for structured error handling.
- Wrapping errors and creating error chains.
17. Building Microservices:
- Principles of microservices architecture.
- Building and deploying microservices using Go.
18. Security Best Practices:
- Preventing common security vulnerabilities like SQL injection and XSS attacks.
- Handling authentication and authorization.
19. Memory Profiling and Optimization:
- Profiling memory usage.
Optimizing memory consumption and garbage collection.
20. Advanced Topics in Go:
- Context-aware logging.
Using third-party libraries effectively.
learning-go's People
Contributors
Watchers