Dreams of Code Logo
Command Line Applications in Go
Introduction
7 lessons
Introduction to the course
02:58
Welcome!
04:56
Setting up your environment
15:27
Go 101: Variables, Values & Types
24:33
Go 101: Conditionals & Loops
19:26
Go 101: Functions & Pointers
17:09
Go 101: Packages
12:44
Counting Words
7 lessons
Starting a new project
12:41
Reading from a file
11:23
A Simple Word Counter
09:30
Writing tests
15:34
Edge cases
10:35
Table Driven Testing
13:11
A better algorithm
15:23
Input, Output, & Arguments
13 lessons
Introduction to input
02:19
Exit codes
05:39
Standard error
11:10
Reading large files
23:27
Bytes & ascii
15:12
Unicode & Runes
The bufio package
Decoupling & io.Reader
Command line arguments
Handling multiple errors
Closing files with defer
Standard input
Scanning data
Adding Features
15 lessons
Adding new features
Counting lines
Counting bytes
Encapsulation
File offsets and seeking
Methods
Variadic parameters
Method receivers
CLI flags
Single pass algorithm
Tabular output
Organizing our code
Package visibility
Constructor arguments
Whitebox vs Blackbox testing
Concurrency & Streams
7 lessons
Introduction to concurrency & data
Goroutines & Waitgroups
Channels
Handling async errors
io.TeeReader
io.Pipe
io.MultiWriter
Advanced Testing
8 lessons
Introduction to Advanced Testing
Benchmark testing
End to end testing (e2e)
e2e: Testing files
e2e: Multiple files
Determinstic output
e2e: Testing flags
Creating test helpers
Commands, Signals, & Contexts
11 lessons
Executing commands
Passing in input
Configuring commands
Asynchronous execution
Signals
Graceful shutdown
Cancellation
context.Context
Building a process guard
Opening an editor
Fuzzing finding with fzf
Filesystem & Networking
14 lessons
Introduction to Networking & Files
File flags
File permissions
Walking the filesystem
Lockfiles & PIDFiles
File locks
The net package
TCP Client
DNS lookups
Port scanning
The net/http package
Marshaling & unmarshaling data
Sending files with HTTP
Testing HTTP Requests
Powerful Command Line Applications
22 lessons
Introduction to Powerful CLI Apps
Subcommands
Flagsets
Subcommand Abstraction
Compressing files & data with GZip
Hashing files & data
Password & Secure Input
Have I been pwned?
Environment variables
Configuration files
Advanced Error Handling
Embedding Files
Cross platform code
Build flags
Regular expressions
UI: A Loading Spinner
UI: A Progress Bar
Adding color to Stdout
Working with images
Distributing an application
An Application Builder
Handling CGO
Popular CLI Packages
12 lessons
Introduction to Popular CLI packages
Subcommands with Cobra
POSIX flags with pFlag
Storing data with SQLite
Database Migrations with Migrate
Repositories with SQLc
Color with color
TUI with Bubble Tea
Forms with huh
Test assertions with Testify
Mocking with go-mock
Releasing with Go releaser
Final Project
Coming Soon
Introduction to Final Project
Coming Soon
Installing Ollama
Coming Soon
Obtaining staged changes
Coming Soon
Handling errors
Coming Soon
Performing HTTP Requests
Coming Soon
Adding in retry
Coming Soon
Interfaces
Coming Soon
Adding another provider
Coming Soon
Commiting our messages
Coming Soon
Introduction
7 lessons
Introduction to the course
02:58
Welcome!
04:56
Setting up your environment
15:27
Go 101: Variables, Values & Types
24:33
Go 101: Conditionals & Loops
19:26
Go 101: Functions & Pointers
17:09
Go 101: Packages
12:44
Counting Words
7 lessons
Starting a new project
12:41
Reading from a file
11:23
A Simple Word Counter
09:30
Writing tests
15:34
Edge cases
10:35
Table Driven Testing
13:11
A better algorithm
15:23
Input, Output, & Arguments
13 lessons
Introduction to input
02:19
Exit codes
05:39
Standard error
11:10
Reading large files
23:27
Bytes & ascii
15:12
Unicode & Runes
The bufio package
Decoupling & io.Reader
Command line arguments
Handling multiple errors
Closing files with defer
Standard input
Scanning data
Adding Features
15 lessons
Adding new features
Counting lines
Counting bytes
Encapsulation
File offsets and seeking
Methods
Variadic parameters
Method receivers
CLI flags
Single pass algorithm
Tabular output
Organizing our code
Package visibility
Constructor arguments
Whitebox vs Blackbox testing
Concurrency & Streams
7 lessons
Introduction to concurrency & data
Goroutines & Waitgroups
Channels
Handling async errors
io.TeeReader
io.Pipe
io.MultiWriter
Advanced Testing
8 lessons
Introduction to Advanced Testing
Benchmark testing
End to end testing (e2e)
e2e: Testing files
e2e: Multiple files
Determinstic output
e2e: Testing flags
Creating test helpers
Commands, Signals, & Contexts
11 lessons
Executing commands
Passing in input
Configuring commands
Asynchronous execution
Signals
Graceful shutdown
Cancellation
context.Context
Building a process guard
Opening an editor
Fuzzing finding with fzf
Filesystem & Networking
14 lessons
Introduction to Networking & Files
File flags
File permissions
Walking the filesystem
Lockfiles & PIDFiles
File locks
The net package
TCP Client
DNS lookups
Port scanning
The net/http package
Marshaling & unmarshaling data
Sending files with HTTP
Testing HTTP Requests
Powerful Command Line Applications
22 lessons
Introduction to Powerful CLI Apps
Subcommands
Flagsets
Subcommand Abstraction
Compressing files & data with GZip
Hashing files & data
Password & Secure Input
Have I been pwned?
Environment variables
Configuration files
Advanced Error Handling
Embedding Files
Cross platform code
Build flags
Regular expressions
UI: A Loading Spinner
UI: A Progress Bar
Adding color to Stdout
Working with images
Distributing an application
An Application Builder
Handling CGO
Popular CLI Packages
12 lessons
Introduction to Popular CLI packages
Subcommands with Cobra
POSIX flags with pFlag
Storing data with SQLite
Database Migrations with Migrate
Repositories with SQLc
Color with color
TUI with Bubble Tea
Forms with huh
Test assertions with Testify
Mocking with go-mock
Releasing with Go releaser
Final Project
Coming Soon
Introduction to Final Project
Coming Soon
Installing Ollama
Coming Soon
Obtaining staged changes
Coming Soon
Handling errors
Coming Soon
Performing HTTP Requests
Coming Soon
Adding in retry
Coming Soon
Interfaces
Coming Soon
Adding another provider
Coming Soon
Commiting our messages
Coming Soon
/
/
  1. Command Line Applications in Go
  2. Filesystem & Networking
  3. The net package
Dreams of Code Logo
Video thumbnail
Locked video

Please purchase the course to watch this video.

Filesystem & Networking
The net package
09:28

Full Course

$299$199
USD
EARLY BIRD OFFER!
The ability to interact with network resources is crucial for building robust CLI applications, and the Go standard library offers effective tools for this purpose through its `net` package. This package facilitates the creation of TCP servers, enabling developers to establish and manage connections seamlessly. By utilizing functions like `net.Listen` and `net.Dial`, one can create a simple echo server that accepts client connections and responds by echoing back any received data. The lesson highlights essential practices like error handling, utilizing goroutines for concurrent connection management, and leveraging the `io` and `bufio` packages for efficient data transfer and logging. It also touches on more advanced functionalities available for fine-tuning connections, such as `ListenTCP` for tailored server settings, underscoring the flexibility and power of Go's networking capabilities.