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/http package
Dreams of Code Logo
Video thumbnail
Locked video

Please purchase the course to watch this video.

Filesystem & Networking
The net/http package
17:31

Full Course

$299$199
USD
EARLY BIRD OFFER!
Networking in Go often involves higher-level protocols like HTTP, which is essential for creating web servers and clients that communicate with APIs. Utilizing the `net/http` package from the Go standard library simplifies the process of sending HTTP requests and handling responses. This lesson demonstrates how to send GET and POST requests to a service like HTTP Bin, illustrating the use of context for managing requests, setting query parameters, and adding custom headers. Additionally, it highlights best practices such as creating a custom HTTP client, handling errors through status codes, and configuring form data. Effective management of HTTP requests is crucial for creating robust command-line applications and understanding response formats like JSON bolsters data handling. As HTTP interactions evolve, familiarity with encoding and decoding techniques will further enhance effective API communication.