Skip to content

Commit 6ed9d84

Browse files
committed
docs(readme): standardize and correct example directory formatting
- Fix typos in example directory names and descriptions - Correct the numbering of examples and ensure consistent formatting Signed-off-by: appleboy <[email protected]>
1 parent 6ec5356 commit 6ed9d84

File tree

1 file changed

+58
-57
lines changed

1 file changed

+58
-57
lines changed

README.md

Lines changed: 58 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,61 +6,62 @@ Learning basic [Golang](https://go.dev/) in one day
66

77
## Example code
88

9-
* [example01](./example01-hello-world): Show hello world. Try to use [golint][1] and [gofmt][2] tool.
10-
* [example02](./example02-golang-package): Let's [write a library][3] and use it from the hello program.
11-
* [example03](./example03-if-switch-const): How to use `if`, `switch` and `const` in Go.
12-
* [example04](./example04-constructor-and-struct): How to initializing `constructor` in Go.
13-
* [example05](./example05-interface): Create interface for multiple struct.
14-
* [example06](./example06-go-concurrency): How to use Goroutines in Go, share by communicating.
15-
* [example07](./example07-errors-hanlder): Errors handler in Go.
16-
* [example08](./example08-type-assertions): A type assertion provides access to an interface value.
17-
* [example09](./example09-command-line-tool): Write command line tool in Go.
18-
* [example10](./example10-simple-http-server): Simple http server and show example using [gin][4] framework.
19-
* [example11](./example11-cross-build): Learn go build constraints.
20-
* [example12](./example12-build-with-docker): Building minimal docker containers for go application.
21-
* [example13](./example13-share-golang-package-to-c): Sharing Golang packages to C and Go.
22-
* [example14](./example14-go-func): How to use func in go?
23-
* [example15](./example15-pass-slice-as-function-args): How to pass slice as function arguments?
24-
* [example16](./example16-init-func): What is init function in Go?
25-
* [example17](./example17-json): How to handle json in Go?
26-
* [example18](./example18-write-testing-and-doc): How to write testingin Go?
27-
* [example19](./example19-deploy-with-kubernetes): Deploy golang app using [drone](https://drone.io/) + [kubernetes](https://kubernetes.io/).
28-
* [example20](./example20-write-benchmark): write simple benchmark.
29-
* [exmaple21](./example21-simple-golang-https-tls): Simple https-tls server example using [mkcert](https://github.com/FiloSottile/mkcert).
30-
* [exmaple22](./example22-go-module-in-go.11): How to use [go module](https://github.com/golang/go/wiki/Modules) in go version 1.11.
31-
* [example23](./example23-deploy-go-application-with-up): Deploy go application useing [apex/up](https://github.com/apex/up) tool.
32-
* [example24](./example24-debug-go-code-using-vs-code): Debug golang code in vscode using [dlv](https://github.com/go-delve/delve).
33-
* [example25](./example25-traefik-golang-app-lets-encrypt): Running golang app using [traefik & Let's Encrypt & Docker](https://docs.traefik.io/user-guide/docker-and-lets-encrypt/).
34-
* [example27](./example27-how-to-load-env): How to loads environment variables from `.env`.
35-
* [example28](./example28-webserver-with-gracefull-shutdown): Go webserver with gracefull shutdown.
36-
* [example29](./example29-handle-multiple-channel): How to handle multiple Go channel?
37-
* [example30](./example30-context-timeout): Simplest Way to Handle Timeouts?
38-
* [example31](./example31-job-queue): How to implements a simple job queue? [Youtube](https://www.youtube.com/watch?v=wvdbobFiXNg)
39-
* [example32](./example32-what-is-select): four tips with `select` in golang.
40-
* [example33](./example33-share-memory-by-communicating): share memory by communicating.
41-
* [example34](./example34-graceful-shutdown-with-worker): graceful shutdown with multiple workers.
42-
* [example35](./example35-goroutine-with-context): introduction to context package.
43-
* [example36](./example36-performance): performance result with differnet concat string method.
44-
* [example38](./example38-concurrency-is-still-not-easy): concurrency is still not easy. [English Blog](https://utcc.utoronto.ca/~cks/space/blog/programming/GoConcurrencyStillNotEasy), [Chinese Blog](https://blog.wu-boy.com/2020/09/limit-concurrency-in-golang/)
45-
* [example39](./example39-select-random-channel): select random channel value?
46-
* [example40](./example40-embedding-files): [go 1.16](https://tip.golang.org/doc/go1.16) support [Embedding Files](https://tip.golang.org/pkg/embed/), [Chinese Blog](https://blog.wu-boy.com/2020/12/embedding-files-in-go-1-16/)
47-
* [example41](./example41-using-buffer-channel-signal) why use buffered channel signal? [Chinese Blog](https://blog.wu-boy.com/2021/03/why-use-buffered-channel-in-signal-notify/)
48-
* [example42](./example42-three-goroutine-interview/README.md) Please use three goroutines to run 10 times each, and output `cat`, `dog`, `bird` in order
49-
* [example43](./example43-progress-bar/README.md) graceful shutdown with progress bar. [Chinese Blog](https://blog.wu-boy.com/2021/05/graceful-shutdown-with-progress-bar-in-golang/)
50-
* [example44](./example44-signal-with-docker-compose) graceful stop service using docker-compose. [Chinese Blog](https://blog.wu-boy.com/2021/06/graceful-stop-service-using-docker-compose-in-golang/)
51-
* [example45](./example45-go-1.18-generics) introduction to go1.18 generics. [Chinese Blog](https://blog.wu-boy.com/2022/02/introduction-to-golang-1-18-generics/)
52-
* [example46](./example46-go-1.18-generics-part2) introduction to go1.18 generics constraints, slices and maps packages. [Chinese Blog](https://blog.wu-boy.com/2022/02/golang-1-18-generics-constraints-slices-maps/)
53-
* [example47](./example47-pyroscope-adhoc-profiling) pyroscope adhoc profiling in go. [Chinese Blog](https://blog.wu-boy.com/2022/02/pyroscope-adhoc-profiling-in-golang/)
54-
* [example48](./example48-pub-sub-pattern) simple pub/sub pattern in go. [Chinese Blog](https://blog.wu-boy.com/2022/04/simple-publish-subscribe-pattern-in-golang/)
55-
* [example49](./example49-dependency-injection/) Dependency Injection using wire tool. [Chinese Blog](https://blog.wu-boy.com/2022/09/dependency-injection-in-go/)
56-
* [exmaple50](./example50-consumer-producer-pattern/) simple scheduler with multiple worker. [Chinese Blog](https://blog.wu-boy.com/2022/11/simple-scheduler-with-multiple-worker-using-golang/)
57-
* [example51](./example51-canceler/) How to cancel a running task between backend and worker service. [Chinese Blog](https://blog.wu-boy.com/2022/12/system-design-how-to-cancel-a-running-task-in-golang/)
58-
* [example52](./example52-ring-buffer-queue/) ring buffer queue with fixed size. [Chinese Blog](https://blog.wu-boy.com/2023/01/ring-buffer-queue-with-fixed-size-in-golang/)
59-
* [example53](./example53-container-base-image-updates/) A container-based solution for automating Docker container base image updates. [Chinese Blog](https://blog.wu-boy.com/2023/02/automating-docker-container-base-image-updates-cht/), [English Blog](https://blog.wu-boy.com/2023/02/automating-docker-container-base-image-updates-eng/)
60-
* [exmaple54](./example54-hot-reload-for-development) introduction live reload tool: air [Chinese Blog](https://blog.wu-boy.com/2023/10/live-reload-in-go/)
61-
* [example55](./example55-cache-hotspot-invalid/) how to invalidate cache hotspot in golang. [Chinese Blog](https://blog.wu-boy.com/2024/02/how-to-reslove-the-hotspot-invalid-using-singleflight/), [English Blog](https://blog.wu-boy.com/2024/02/how-to-reslove-the-hotspot-invalid-using-singleflight-en/)
9+
- [example01](./example01-hello-world): Show hello world. Try to use [golint][1] and [gofmt][2] tool.
10+
- [example02](./example02-golang-package): Let's [write a library][3] and use it from the hello program.
11+
- [example03](./example03-if-switch-const): How to use `if`, `switch` and `const` in Go.
12+
- [example04](./example04-constructor-and-struct): How to initializing `constructor` in Go.
13+
- [example05](./example05-interface): Create interface for multiple struct.
14+
- [example06](./example06-go-concurrency): How to use Goroutines in Go, share by communicating.
15+
- [example07](./example07-errors-hanlder): Errors handler in Go.
16+
- [example08](./example08-type-assertions): A type assertion provides access to an interface value.
17+
- [example09](./example09-command-line-tool): Write command line tool in Go.
18+
- [example10](./example10-simple-http-server): Simple http server and show example using [gin][4] framework.
19+
- [example11](./example11-cross-build): Learn go build constraints.
20+
- [example12](./example12-build-with-docker): Building minimal docker containers for go application.
21+
- [example13](./example13-share-golang-package-to-c): Sharing Golang packages to C and Go.
22+
- [example14](./example14-go-func): How to use func in go?
23+
- [example15](./example15-pass-slice-as-function-args): How to pass slice as function arguments?
24+
- [example16](./example16-init-func): What is init function in Go?
25+
- [example17](./example17-json): How to handle json in Go?
26+
- [example18](./example18-write-testing-and-doc): How to write testingin Go?
27+
- [example19](./example19-deploy-with-kubernetes): Deploy golang app using [drone](https://drone.io/) + [kubernetes](https://kubernetes.io/).
28+
- [example20](./example20-write-benchmark): write simple benchmark.
29+
- [exmaple21](./example21-simple-golang-https-tls): Simple https-tls server example using [mkcert](https://github.com/FiloSottile/mkcert).
30+
- [exmaple22](./example22-go-module-in-go.11): How to use [go module](https://github.com/golang/go/wiki/Modules) in go version 1.11.
31+
- [example23](./example23-deploy-go-application-with-up): Deploy go application useing [apex/up](https://github.com/apex/up) tool.
32+
- [example24](./example24-debug-go-code-using-vs-code): Debug golang code in vscode using [dlv](https://github.com/go-delve/delve).
33+
- [example25](./example25-traefik-golang-app-lets-encrypt): Running golang app using [traefik & Let's Encrypt & Docker](https://docs.traefik.io/user-guide/docker-and-lets-encrypt/).
34+
- [example27](./example27-how-to-load-env): How to loads environment variables from `.env`.
35+
- [example28](./example28-webserver-with-gracefull-shutdown): Go webserver with gracefull shutdown.
36+
- [example29](./example29-handle-multiple-channel): How to handle multiple Go channel?
37+
- [example30](./example30-context-timeout): Simplest Way to Handle Timeouts?
38+
- [example31](./example31-job-queue): How to implements a simple job queue? [Youtube](https://www.youtube.com/watch?v=wvdbobFiXNg)
39+
- [example32](./example32-what-is-select): four tips with `select` in golang.
40+
- [example33](./example33-share-memory-by-communicating): share memory by communicating.
41+
- [example34](./example34-graceful-shutdown-with-worker): graceful shutdown with multiple workers.
42+
- [example35](./example35-goroutine-with-context): introduction to context package.
43+
- [example36](./example36-performance): performance result with differnet concat string method.
44+
- [example38](./example38-concurrency-is-still-not-easy): concurrency is still not easy. [English Blog](https://utcc.utoronto.ca/~cks/space/blog/programming/GoConcurrencyStillNotEasy), [Chinese Blog](https://blog.wu-boy.com/2020/09/limit-concurrency-in-golang/)
45+
- [example39](./example39-select-random-channel): select random channel value?
46+
- [example40](./example40-embedding-files): [go 1.16](https://tip.golang.org/doc/go1.16) support [Embedding Files](https://tip.golang.org/pkg/embed/), [Chinese Blog](https://blog.wu-boy.com/2020/12/embedding-files-in-go-1-16/)
47+
- [example41](./example41-using-buffer-channel-signal) why use buffered channel signal? [Chinese Blog](https://blog.wu-boy.com/2021/03/why-use-buffered-channel-in-signal-notify/)
48+
- [example42](./example42-three-goroutine-interview/README.md) Please use three goroutines to run 10 times each, and output `cat`, `dog`, `bird` in order
49+
- [example43](./example43-progress-bar/README.md) graceful shutdown with progress bar. [Chinese Blog](https://blog.wu-boy.com/2021/05/graceful-shutdown-with-progress-bar-in-golang/)
50+
- [example44](./example44-signal-with-docker-compose) graceful stop service using docker-compose. [Chinese Blog](https://blog.wu-boy.com/2021/06/graceful-stop-service-using-docker-compose-in-golang/)
51+
- [example45](./example45-go-1.18-generics) introduction to go1.18 generics. [Chinese Blog](https://blog.wu-boy.com/2022/02/introduction-to-golang-1-18-generics/)
52+
- [example46](./example46-go-1.18-generics-part2) introduction to go1.18 generics constraints, slices and maps packages. [Chinese Blog](https://blog.wu-boy.com/2022/02/golang-1-18-generics-constraints-slices-maps/)
53+
- [example47](./example47-pyroscope-adhoc-profiling) pyroscope adhoc profiling in go. [Chinese Blog](https://blog.wu-boy.com/2022/02/pyroscope-adhoc-profiling-in-golang/)
54+
- [example48](./example48-pub-sub-pattern) simple pub/sub pattern in go. [Chinese Blog](https://blog.wu-boy.com/2022/04/simple-publish-subscribe-pattern-in-golang/)
55+
- [example49](./example49-dependency-injection/) Dependency Injection using wire tool. [Chinese Blog](https://blog.wu-boy.com/2022/09/dependency-injection-in-go/)
56+
- [exmaple50](./example50-consumer-producer-pattern/) simple scheduler with multiple worker. [Chinese Blog](https://blog.wu-boy.com/2022/11/simple-scheduler-with-multiple-worker-using-golang/)
57+
- [example51](./example51-canceler/) How to cancel a running task between backend and worker service. [Chinese Blog](https://blog.wu-boy.com/2022/12/system-design-how-to-cancel-a-running-task-in-golang/)
58+
- [example52](./example52-ring-buffer-queue/) ring buffer queue with fixed size. [Chinese Blog](https://blog.wu-boy.com/2023/01/ring-buffer-queue-with-fixed-size-in-golang/)
59+
- [example53](./example53-container-base-image-updates/) A container-based solution for automating Docker container base image updates. [Chinese Blog](https://blog.wu-boy.com/2023/02/automating-docker-container-base-image-updates-cht/), [English Blog](https://blog.wu-boy.com/2023/02/automating-docker-container-base-image-updates-eng/)
60+
- [exmaple54](./example54-hot-reload-for-development) introduction live reload tool: air [Chinese Blog](https://blog.wu-boy.com/2023/10/live-reload-in-go/)
61+
- [example55](./example55-cache-hotspot-invalid/) how to invalidate cache hotspot in golang. [Chinese Blog](https://blog.wu-boy.com/2024/02/how-to-reslove-the-hotspot-invalid-using-singleflight/), [English Blog](https://blog.wu-boy.com/2024/02/how-to-reslove-the-hotspot-invalid-using-singleflight-en/)
62+
- [example56](./example56-context-with-timeout/) how to use context with timeout in golang. [Chinese Blog](https://blog.wu-boy.com/2024/11/learning-go-language-with-gitlab-api-zh-tw/), [English Blog](https://blog.wu-boy.com/2024/11/learning-go-language-with-gitlab-api-en/)
6263

63-
[1]:https://github.com/golang/lint
64-
[2]:https://golang.org/cmd/gofmt/
65-
[3]:https://golang.org/doc/code.html#Library
66-
[4]:https://github.com/gin-gonic/gin
64+
[1]: https://github.com/golang/lint
65+
[2]: https://golang.org/cmd/gofmt/
66+
[3]: https://golang.org/doc/code.html#Library
67+
[4]: https://github.com/gin-gonic/gin

0 commit comments

Comments
 (0)