Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
57 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
Code samples for <a href="https://blog.kowalczyk.info/book/go-cookbook.html">Go Cookbook</a> chapter on | ||
<a href="">3 ways to iterate</a>. | ||
Code samples from [Go Cookbook](https://blog.kowalczyk.info/book/go-cookbook.html). | ||
|
||
Chapter: [3 ways to iterate](https://blog.kowalczyk.info/article/1Bkr/3-ways-to-iterate-in-go.html). | ||
|
||
Legend: | ||
|
||
* <a href="inlined.go">inlined.go</a> : iteration and processing commingled | ||
* <a href="callback.go">callback.go</a> : iteration code calls a processing callback for each item | ||
* <a href="channel.go">channel.go</a> : iterator sends item over a channel | ||
* <a href="next.go">next.go</a> : iterator is a struct that implements `Next` method to advance to the next item | ||
* [inlined.go](inlined.go) : iteration and processing commingled | ||
* [callback.go](callback.go) : iteration code calls a processing callback for each item | ||
* [channel.go](channel.go) : iterator sends item over a channel | ||
* [next.go](next.go) : iterator is a struct that implements `Next` method to advance to the next item |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
Code for my [Go Cookbok](https://blog.kowalczyk.info/book/go-cookbook.html) articles. | ||
|
||
All code samples are [public domain](https://en.wikipedia.org/wiki/Public_domain). | ||
You can use them any way you want, without attribution. | ||
|
||
Legend: | ||
* [Advanced command execution in Go with os/exec](https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html), code: [advanced-exec](/advanced-exec) | ||
* [Generating good, random and unique ids in Go](https://blog.kowalczyk.info/article/JyRZ/generating-good-random-and-unique-ids-in-go.html), code: [generate-unique-id](/generate-unique-id) | ||
* [HTTPS for free in Go](https://blog.kowalczyk.info/article/Jl3G/https-for-free-in-go.html), code: [free-ssl-certificates](/free-ssl-certificates) | ||
|
||
All code samples are [public domain](https://en.wikipedia.org/wiki/Public_domain). | ||
You can use them any way you want, without attribution. | ||
Drafts: | ||
* [3 ways to iterate](https://blog.kowalczyk.info/article/1Bkr/3-ways-to-iterate-in-go.html) | ||
* [Embedding build number in Go executable](https://blog.kowalczyk.info/article/vEja/embedding-build-number-in-go-executable.html) | ||
* [Using MySQL in Docker for local testing In Go](https://blog.kowalczyk.info/article/w4re/using-mysql-in-docker-for-local-testing-in-go.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
Code samples for <a href="https://blog.kowalczyk.info/book/go-cookbook.html">Go Cookbook</a> chapter on | ||
<a href="https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html">advanced command execution with os/exec</a>. | ||
Code samples from [Go Cookbook](https://blog.kowalczyk.info/book/go-cookbook.html). | ||
|
||
Chapter: [advanced command execution with os/exec](https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html). | ||
|
||
Legend: | ||
* [01-simple-exec.go](01-simple-exec.go) : execute the command | ||
* [02-capture-stdout-stderr.go](02-capture-stdout-stderr) : execute and capture stdout and stderr | ||
* [03-live-progress-and-capture-v1.go](03-live-progress-and-capture-v1.go) : execute, capture output, show output during execution, version 1 | ||
* [03-live-progress-and-capture-v2.go](03-live-progress-and-capture-v2.go) : execute, capture output, show output during execution, version 2 | ||
* [03-live-progress-and-capture-v3.go](03-live-progress-and-capture-v3.go) : execute, capture output, show output during execution, version 3 | ||
* [04-check-exe-exists.go](04-check-exe-exists.go) : verify executable exists before trying to run it | ||
* [05-change-environment.go](05-change-environment.go) : change environment variables of the process | ||
* [06-feed-stdin.go](06-feed-stdin.go) : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
Code samples for <a href="https://blog.kowalczyk.info/book/go-cookbook.html">Go Cookbook</a> | ||
chapter on <a href="">embedding build number in Go executable</a>. | ||
Code samples from [Go Cookbook](https://blog.kowalczyk.info/book/go-cookbook.html). | ||
|
||
Chapter: [embedding build number in Go executable](https://blog.kowalczyk.info/article/vEja/embedding-build-number-in-go-executable.html). | ||
|
||
Legend: | ||
* [main.go](main.go) : test program | ||
* [build.sh](build.sh) : mac/unix build script | ||
* [build.ps1](build.ps1) : windows build script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
Code samples for <a href="https://blog.kowalczyk.info/book/go-cookbook.html">Go Cookbook</a> | ||
chapter on <a href="https://blog.kowalczyk.info/article/Jl3G/https-for-free-in-go.html">HTTPS for free, with little help of Let's Encrypt</a>. | ||
Code samples from [Go Cookbook](https://blog.kowalczyk.info/book/go-cookbook.html). | ||
|
||
Chapter: [HTTPS for free in Go, with little help of Let's Encrypt](https://blog.kowalczyk.info/article/Jl3G/https-for-free-in-go.html). | ||
|
||
Legend: | ||
* [main.go](main.go) : simple web server showing how to serve HTTPS using free Let's Encrpt certificate and how to redirect from HTTP to HTTPS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
Code samples for <a href="https://blog.kowalczyk.info/book/go-cookbook.html">Go Cookbook</a> | ||
chapter on <a href="https://blog.kowalczyk.info/article/JyRZ/generating-good-random-and-unique-ids-in-go.html">generating good unique ids</a>. A survey of 7 libraries. | ||
Code samples from [Go Cookbook](https://blog.kowalczyk.info/book/go-cookbook.html). | ||
|
||
Chapter: [generating good unique ids](https://blog.kowalczyk.info/article/JyRZ/generating-good-random-and-unique-ids-in-go.html) | ||
|
||
Legend: | ||
* [main.go](main.go) : test program that shows unique id generated with 7 different libraries | ||
|
||
You might need to `go get -u ./...` to install the libraries. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
Code samples for chapter on <a href="">embedding HTTP assets in Go Executable</a> | ||
from <a href="https://blog.kowalczyk.info/book/go-cookbook.html">Go Cookbook</a>. | ||
Code samples from [Go Cookbook](https://blog.kowalczyk.info/book/go-cookbook.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
Code samples for chapter on <a href="">Using MySQL in Docker for local testing</a> | ||
from <a href="https://blog.kowalczyk.info/book/go-cookbook.html">Go Cookbook</a>. | ||
Code samples from [Go Cookbook](https://blog.kowalczyk.info/book/go-cookbook.html). | ||
|
||
You must have <a href="https://www.docker.com/">docker</a> installed. | ||
Chapter: [Using MySQL in Docker for local testing In Go](https://blog.kowalczyk.info/article/w4re/using-mysql-in-docker-for-local-testing-in-go.html). | ||
|
||
You must have [docker](https://www.docker.com) installed. | ||
|
||
Legend: | ||
* [main.go](main.go) : shows how to programmatically start MySQL running inside a Docker container and obtain ip address to connect to |