Description
In this course, you will learn :
- The language's fundamental constructs and techniques.
- The fundamentals, you will progress to more advanced Go concepts such as error handling, networking, and templating.
- How to programme in Go efficiently by becoming familiar with common pitfalls and patterns, as well as by creating your own applications.
Syllabus :
1. Origin, Context and Popularity of GO
- Origin and Evolution of Go
- Reasons for Developing Go
- Characteristics of Go
- Test Yourself
2. Basic Constructs and Elementary Data Types
- Filenames, Keywords and Identifiers
- Import Functionality
- Overview of Functions
- Overview of Data Types
- Constants
- Variables
- Scope of Variables
- Elementary Types
- Operators
- Strings
- Strings and strconv Package
- Times and Dates
- Pointers
3. Control Structures
- The if-else Construct
- Testing for Errors on Functions
- The switch-case Construct
- The for Construct
- The for range Construct
- Break and Continue
- Use of Labels - goto
4. Functions
- Introduction to Functions
- Parameters and Return Values
- Defer and Tracing
- Built-in Functions
- Recursive Functions
- Challenge: Compute Factorial of a Number
- Solution Review: Compute Factorial of a Number
- Higher-Order Functions
- Challenge: Filter Even and Odd Numbers
- Solution Review: Filter Even and Odd Numbers
- Closures
- Functions as Return Variables
- Debugging with Closures
- Optimizing Programs
5. Arrays and Slices
- Declaration and Initialization
- Array Literals and Parameters
- Slices
- Slices with Functions
- Multidimensionality
- Bytes and Slices
- The for-range Construct
- Reslicing
- Copying and Appending Slices
6. Maps
- Declaration and Initialization
- Existence of Key-Value Item
- The for range Construct
- A Slice of Maps
- Sorting and Inverting a Map
7. Packages
- Overview of the Standard Library
- The regexp Package
- Locking and the sync Package
- Accurate Computations and the big Package
- Custom Packages and Visibility
- Documenting Your Packages
- Custom Packages: Folder Structure, go install and go test
- Using git for Distribution
- External Packages, Projects and Libraries
- Installing External Packages
8. Structs and Methods
- Introduction to Struct
- Advanced Structs Concepts
- Factory Method
- Structs with Tags
- Anonymous Fields and Embedded Structs
- Introduction to Methods
- Methods Versus Functions
- Receivers and Methods as Pointers and Values
- Non-Exported Fields
- String() Method and Format Specifiers
- Methods on Embedded Types
- Multiple Inheritance
- Garbage Collection and SetFinalizer
9. Interfaces and Reflection
- What is an Interface?
- Embedded Interface and Type Assertions
- The Type Switch
- Implementation of Interfaces
- Sorting with the Sorter Interface
- Reading and Writing
- Empty Interface
- The reflect Package
- Printf and Reflection
- Interfaces and Dynamic Typing
- Structs, Collections and Higher-Order Functions
- The Object Orientation in Go
10. Reading and Writing
- Reading Input from the User
- Reading from a File
- Writing to a File
- Copying Files
- Reading Arguments from the Command-Line
- Reading Files with a Buffer
- Reading and Writing Files with Slices
- Scanning Inputs
- A Practical Example of Interfaces
- The JSON Data Format
- Decoding with JSON
- The XML Data Format
- Data Transport through gob
- Cryptography with Go
11. Error-Handling and Testing
- Error-Handling
- Run-time Exceptions and Panic
- Recover
- Error-Handling and Panicking in a User-Defined Package
- Error-Handling Scheme with Closures
- Starting an External Command or Program
- Testing and Benchmarking in Go
- Testing: A Concrete Example
- Using Table-Driven Tests
- Investigating Performance
12. Goroutines and Channels
- Handling Concurrency and Parallelism with Go
- Implementing Goroutines
- Introduction to Channels
- Synchronous and Asynchronous Communication
- Semaphore Pattern
- Channel Factory and Producer-Consumer Pattern
- Channel Directionality
- Synchronization of goroutines
- Switching between goroutines
- Channels, Timeouts, and Tickers
- Using recover with goroutines
- Tasks and Worker Processes
- Implementing a Lazy Generator
- Anonymous Closure
- Implementing Futures
- Multiplexing
- Limiting the Number of Requests
- Chaining and Parallelizing Computation
- The Leaky Bucket Algorithm
- Benchmarking, Accessing and Listening
13. Networking, Templating and Web-Applications
- A TCP Server
- A Simple Web Server
- Polling Websites and Reading Web Page
- Writing a Simple Web Application
- Making a Web Application Robust
- Writing Web Application with Templates
- Exploring the template Package
- An Elaborate Web Server
- Remote Procedure Calls with RPC
- Sending Mails with SMTP
- Go in the Cloud
14. Common Go Pitfalls and Patterns
- Regular Mistakes and Suggestions
- Highlights from the Previous Chapters
- The comma, ok Pattern
- The defer Pattern
- Visibility and Operator Patterns
15. Performance Advices
- Strings, Arrays and Slices
- Structs, Interfaces and Maps
- Functions and Files
- Goroutines and Networking
- Suggestions and Considerations
16. Building a Complete Application
- Setting up the Structure of Application
- Our User Interface
- Persistent Storage with gob
- Using goroutines for Performance
- Persistent Storage with JSON
- Enhancements