Get in Touch
 Duration 28 hours

Course Outline

1. Introduction to Go

  • Defining Go (Golang): Core concepts and utility
  • Historical context and design philosophy
  • Go’s role in web and systems programming
  • Key architectural characteristics:
    • Static typing mechanisms
    • Emphasis on simplicity and readability
    • Rapid compilation speeds
    • Native concurrency support
    • Automated garbage collection
    • Cross-platform compilation capabilities
  • Primary use cases for Go technology
  • Analysis of advantages and potential limitations
  • Comparative analysis with C/C++, JavaScript, Ruby, Python, and Java
  • Navigating the Go ecosystem
  • Overview of the comprehensive standard library
  • Go modules and dependency management strategies
  • Anatomy of a standard Go application
  • Practical Session: Examine and execute a foundational Go program

2. Establishing the Go Development Environment

  • Installation procedures for Go
  • Understanding the components of the Go toolchain
  • Configuration of essential environment variables
  • Selecting the optimal IDE or code editor
  • Interacting with Go via the command line
  • Setting up a dedicated Go workspace
  • Understanding standard project structures
  • Initializing new projects using Go Modules
  • Executing go mod init for project setup
  • Managing external dependencies using go get
  • Updating and auditing project dependencies
  • Standardizing code style with gofmt
  • Running programs efficiently with go run
  • Compiling applications using go build
  • Installing Go applications for local execution
  • Techniques for cross-compiling applications
  • Practical Session: Create and configure a Go project within a containerized environment

3. Variables, Constants, and Data Types in Go

  • Variable declaration techniques
  • Distinguishing between explicit and inferred types
  • Utilizing short variable declarations
  • Working with constants
  • Understanding zero values in Go
  • Variable scope and lifecycle management
  • Primitive data types:
    • Integer types
    • Floating-point numbers
    • Complex numbers
    • Boolean values
    • String types
  • Performing type conversions
  • Handling Unicode and UTF-8 encoding
  • Difference between Runes and bytes
  • Multi-variable assignment patterns
  • Maintaining type safety in applications
  • Exercise: Develop a simple command-line data processing utility

4. Operators and Expressions

  • Arithmetic operations
  • Comparison logic
  • Boolean logical operators
  • Assignment operators
  • Increment and decrement operators
  • Understanding operator precedence
  • Managing integer and floating-point calculations
  • Preventing common type-conversion pitfalls
  • Exercise: Implement calculation and validation logic

5. Managing Dates, Times, and Formatting

  • Leveraging the time package
  • Creating and manipulating date objects
  • Retrieving current time data
  • Handling time zones and geographical locations
  • Parsing date and time strings
  • Customizing date and time formats
  • Calculating time durations
  • Working with Unix timestamps
  • Implementing timeout mechanisms
  • Exercise: Integrate timestamps and duration calculations into an application

6. Arrays, Slices, Maps, and Structs

Arrays

  • Array declaration syntax
  • Initializing array values
  • Iterating through arrays
  • Handling multidimensional arrays

Slices

  • Distinguishing between slices and arrays
  • Creating dynamic slices
  • Appending elements to slices
  • Copying slice data
  • Managing slice length and capacity
  • Slicing existing slices
  • Avoiding common slice-related errors

Maps

  • Initializing maps
  • Adding and removing map entries
  • Verifying key existence
  • Iterating over map key-value pairs
  • Storing complex data structures in maps

Structs

  • Defining custom structures

  • Managing struct fields

  • Initializing struct instances

  • Working with nested structs

  • Utilizing anonymous structs

  • Implementing struct methods

  • Using JSON struct tags for serialization

  • Practical Session: Model users, products, and application data using structs, slices, and maps

7. Conditional Logic and Loop Structures

  • Using if statements for logic
  • Implementing else and else if conditions
  • Declaring variables within conditional blocks
  • Using for loops for iteration
  • Creating infinite loops
  • Defining loop termination conditions
  • Controlling flow with break and continue
  • Iterating collections with range
  • Implementing nested loops
  • Using switch statements for multi-way branching
  • Expression-based switch logic
  • Handling multiple cases
  • Defining default cases
  • Implementing type switches
  • Exercise: Develop application validation and processing workflows

8. Functions in Go

  • Function definition syntax
  • Managing function parameters
  • Returning values
  • Handling multiple return values
  • Using named return values
  • Implementing variadic functions
  • Working with anonymous functions
  • Passing functions as values
  • Understanding closures
  • Implementing recursive functions
  • Passing functions as arguments
  • Functions that return errors
  • Designing small, reusable functional units
  • Exercise: Refactor existing codebases into modular, reusable functions

9. Pointers and Memory Management

  • Conceptual understanding of pointers
  • Using address-of and dereference operators
  • Pointers in function parameter passing
  • Implementing pointer receivers
  • Pointers to struct types
  • Handling Nil pointers safely
  • Best practices for pointer usage
  • Distinguishing value vs. reference semantics
  • Go’s memory management and garbage collection mechanisms
  • Common pointer-related mistakes and how to avoid them
  • Practical Session: Modify application data structures using pointers

10. Developing a Web Application in Go

  • Overview of Go’s native web capabilities
  • Introduction to the net/http package
  • Setting up an HTTP server
  • Processing HTTP requests and responses
  • Understanding HTTP methods
  • Handling request URLs and query parameters
  • Managing HTTP headers
  • Interpreting HTTP status codes
  • Foundations of routing logic
  • Creating and registering handlers
  • Processing form data submissions
  • Serving static assets
  • Utilizing HTML templates
  • Implementing template variables and control structures
  • Structuring a scalable web application
  • Practical Session: Build a foundational Go web server

11. Building RESTful Web Services

  • Core principles of REST architecture
  • Designing effective API endpoints
  • Implementing GET, POST, PUT, PATCH, and DELETE methods
  • Working with JSON data formats
  • Encoding and decoding JSON payloads
  • Validating incoming requests
  • Managing HTTP status codes for API responses
  • Constructing standard error responses
  • Handling query and path parameters
  • Designing consistent API response structures
  • Decoupling handlers from business logic
  • Practical Session: Develop a CRUD-based REST API

12. Go Runtime, Compilation, and Project Builds

  • Inside the Go compiler
  • The Go build lifecycle
  • Usage of go run for development
  • Usage of go build for compilation
  • Usage of go install for deployment
  • Running tests with go test
  • Advanced build flag options
  • Configuring environment-specific settings
  • Building for diverse operating systems and architectures
  • Generating standalone binaries
  • Strategies for managing application configuration
  • Exercise: Compile the application for multiple target platforms

13. File Operations and Web Integration

  • Opening and closing file streams
  • Reading data from files
  • Writing data to files
  • Creating and managing directories
  • Accessing file metadata
  • Using buffered I/O for performance
  • Streaming data processing
  • Reading and writing JSON file structures
  • Implementing HTTP clients
  • Executing outbound HTTP requests
  • Handling client-side HTTP errors
  • Implementing timeouts and cancellation logic
  • Processing and parsing API responses
  • Practical Session: Fetch data from external APIs and persist it locally

14. Error Handling and Debugging Strategies

  • Go’s explicit approach to error handling
  • Returning errors from functions
  • Effective error checking patterns
  • Creating custom error types
  • Wrapping errors for context
  • Enriching errors with additional information
  • Using errors.Is and errors.As for comparison
  • Understanding panic and recovery
  • Appropriate use cases for panic
  • Debugging common Go-specific issues
  • Implementing application activity logging
  • Leveraging Go debugging tools
  • Exercise: Diagnose and resolve intentionally introduced application errors

15. Interfaces and Abstraction

  • Conceptual understanding of interfaces
  • Go’s implicit interface implementation
  • Defining custom interfaces
  • Working with interface values
  • Using empty interfaces and the any type
  • Performing type assertions
  • Implementing type switches
  • Pointer vs. value interface implementations
  • Designing small, focused interfaces
  • Applying dependency inversion principles
  • Utilizing interfaces for testability
  • Reducing application coupling through abstraction
  • Practical Session: Integrate interfaces into the sample web application architecture

16. Packages and Project Organization

  • Creating new packages
  • Adhering to package naming conventions
  • Managing exported vs. unexported identifiers
  • Importing external packages
  • Package initialization sequences
  • Structuring application layers effectively
  • Using internal packages for encapsulation
  • Dependency management via Go Modules
  • Implementing semantic versioning
  • Integrating third-party libraries
  • Preventing circular dependencies
  • Designing maintainable, scalable Go projects
  • Exercise: Refactor the application codebase into modular packages

17. Concurrency with Goroutines

  • Foundations of concurrent programming
  • Understanding Goroutines
  • Spawning new goroutines
  • Lightweight concurrent execution models
  • Addressing synchronization challenges
  • Managing shared state
  • Identifying and fixing race conditions
  • Utilizing sync.WaitGroup for coordination
  • Implementing mutexes and read/write mutexes
  • Using atomic operations for thread safety
  • Practical Session: Convert a sequential workflow into concurrent processing

18. Communication via Channels

  • Core concepts of channels
  • Sending and receiving data
  • Difference between buffered and unbuffered channels
  • Understanding blocking behavior
  • Properly closing channels
  • Iterating over channels with range
  • Defining directional channels
  • Channel-based communication patterns
  • Using select statements for multiplexing
  • Implementing timeouts and cancellation
  • Worker-pool design patterns
  • Producer/consumer model implementations
  • Practical Session: Architect a concurrent worker system

19. Context and Request Lifecycle Management

  • The importance of contexts in web applications
  • Using context.Context
  • Request-scoped context propagation
  • Implementing cancellation logic
  • Setting deadlines for operations
  • Configuring timeouts
  • Propagating context across application layers
  • Cancelling long-running database or HTTP operations
  • Avoiding common context misuse patterns
  • Exercise: Implement request cancellation and timeout handling in the web application

20. Testing Go Applications

  • The value of automated testing
  • Writing effective unit tests
  • Utilizing the testing package
  • Structuring test functions
  • Following test naming standards
  • Implementing table-driven tests
  • Testing error paths
  • Testing HTTP handlers
  • Using HTTP test servers
  • Managing test fixtures
  • Measuring test coverage
  • Writing performance benchmarks
  • Creating example-based tests
  • Testing interfaces using mocks or fakes
  • Practical Session: Develop a comprehensive test suite for the sample application

21. Performance Optimization Techniques

  • Analyzing Go application performance
  • Identifying system bottlenecks
  • Optimizing CPU vs. memory usage
  • Selecting efficient data structures
  • Minimizing unnecessary memory allocations
  • Optimizing string, byte, and buffer handling
  • Managing goroutine overhead
  • Preventing excessive concurrency issues
  • Implementing effective caching strategies
  • Considerations for database and network performance
  • Profiling application behavior
  • Conducting benchmarks and performance tests
  • Leveraging Go’s built-in profiling tools
  • Exercise: Profile and optimize a deliberately inefficient application component

22. Security and Robust Web Application Practices

  • Strict validation of user input
  • Safe processing of HTTP requests
  • Mitigating common web security vulnerabilities
  • Implementing secure error handling
  • Foundations of authentication and authorization
  • Managing secrets and configuration securely
  • Enforcing secure HTTP communication
  • Preventing sensitive data leakage in logs
  • Regular dependency management and security updates
  • Setting resource limits and request timeouts
  • Exercise: Audit and harden the sample API against security threats

23. Application Logging and Observability

  • Principles of effective logging
  • Implementing structured logging
  • Managing log levels appropriately
  • Capturing request lifecycle logs
  • Recording error details effectively
  • Using correlation and request IDs
  • Monitoring application behavior in real-time
  • Collecting basic operational metrics
  • Implementing health-check endpoints
  • Diagnosing production environment issues
  • Practical Session: Integrate structured logging and health check mechanisms

24. Containerizing the Go Application

  • Benefits of containerization
  • Go applications in a containerized context
  • Authoring efficient Dockerfiles
  • Utilizing multi-stage builds
  • Creating minimal runtime images
  • Managing configuration via environment variables
  • Configuring container networking
  • Exposing necessary application ports
  • Running the application within a container
  • Testing the containerized build
  • Practical Session: Package the sample Go application as a production-ready container image

25. Deployment Strategies

  • Preparing an application for production readiness
  • Building optimized production binaries
  • Managing environment-specific configuration
  • Implementing container-based deployment workflows
  • Designing deployment architectures
  • Configuring reverse proxies
  • Implementing HTTPS/TLS security
  • Establishing application health checks
  • Implementing graceful shutdown procedures
  • Handling operating-system signals
  • Scaling Go web applications
  • Choosing between horizontal and vertical scaling
  • Troubleshooting common deployment issues
  • Practical Session: Deploy the sample web application to a target environment

26. Capstone: Complete Go Web Application

Participants will synthesize all learned concepts to develop a fully functional application.

The project scope may include:

  • Project initialization using Go Modules
  • Structured package organization
  • Implementation of HTTP routing
  • Development of REST API endpoints
  • Handling JSON request and response cycles
  • Input validation mechanisms
  • Robust error handling
  • Use of interfaces for abstraction
  • Concurrent processing workflows
  • Integration with external APIs
  • File or database persistence layers
  • Comprehensive automated tests
  • Structured logging implementation
  • Performance optimization techniques
  • Containerization setup
  • Production configuration management
  • Final deployment execution

27. Review and Best Practices

  • Recap of core Go syntax
  • Adherence to Go coding conventions
  • Writing idiomatic, natural Go code
  • Maintaining code simplicity
  • Effective package design principles
  • Error handling best practices
  • Interface design guidelines
  • Concurrency best practices
  • Strategic testing approaches
  • Performance optimization considerations
  • Prioritizing maintainability and readability
  • Avoiding common pitfalls for new Go developers
  • Recommended paths for continued Go skill development

28. Conclusion

  • Summary of key concepts covered
  • Review of the completed web application
  • Open Q&A and discussion session
  • Troubleshooting common real-world scenarios
  • Recommended next steps for Go development
  • Exploring additional Go libraries and ecosystem resources
  • Opportunities for building production-grade Go services

Requirements

  • Familiarity with general programming principles is required.

Target Audience

  • Software Developers

Custom Corporate Training

Training solutions designed exclusively for businesses.

  • Customized Content: We adapt the syllabus and practical exercises to the real goals and needs of your project.
  • Flexible Schedule: Dates and times adapted to your team's agenda.
  • Format: Online (live), In-company (at your offices), or Hybrid.
Investment

Price per private group, online live training, starting from 5800 € + VAT*

Contact us for an exact quote and to hear our latest promotions

Testimonials (5)

Upcoming Courses

Related Categories