In this workshop we will cover basic concepts of golang along with sample programs.
Topics:
Session 1: Introduction to Go
- Go installation.
- Why Go?
- Hello, World Program.
- Command-Line Arguments.
- Setting up Go ecosystem.
- Basic Syntax.
Session 2: Program Structure
- Names.
- Declarations.
- Variables.
- Assignments.
- Type Declarations.
- Packages and Files.
- Scope.
Session 3: Basic Data Types
- Integers.
- Floating-Point Numbers.
- Complex Numbers.
- Booleans.
- Strings.
- Constants.
Session 4: Flow Control Statements
- For loop.
- If statements.
- Else statements.
- Switch statements.
- Defer statements.
Session 5: Composite Types
- Arrays.
- Slices.
- Maps.
- Structs.
Session 6: Functions
- Function Declarations.
- Recursion.
- Multiple Return Values.
- Errors.
- Function Values.
- Anonymous Functions.
- Variadic Functions.
- Deferred Function Calls.
- Panic.
- Recover.
Session 7: Methods
- Method Declarations.
- Methods with a Pointer Receiver.
- Composing Types by Struct Embedding.
- Method Values and Expressions.
- Encapsulation.
Session 8: Interfaces
- Interfaces as Contracts.
- Interface Types.
- Interface Satisfaction.
- Parsing Flags with a flag value.
- Interface Values.
- Example: Expression Evaluator.
- Type Assertions.
- Type Switches.
Session 9: Goroutines and Channels
- Goroutines.
- Channels.
- Looping in Parallel.
- Multiplexing with select.
- Cancellation.
Session 11: Packages and the Go Tool
- Introduction.
- Import Paths.
- The Package Declaration.
- Import Declarations.
- Blank Imports.
- Packages and Naming.
- The Go Tool.
Session 12: Testing
- The go test Tool.
- Test Functions.
- Coverage.