39 Commits

Author SHA1 Message Date
Eli Bendersky
15d8fe75b8 Add new example: logging with the log and log/slog packages 2023-08-22 13:45:00 -07:00
Eli Bendersky
840541a6bd Rename http clients/servers to singular language: client/server 2022-09-22 13:44:25 -07:00
Andreas Deininger
da13e2fbe7
Improving links (http -> https) (#425) 2022-06-06 11:31:46 -07:00
Eli Bendersky
36464854b9 Rebuild to have updated index.html in public/ 2022-05-24 20:22:13 -07:00
peterzhu1992
7e4533640b
Add embed-directive example (#423)
* Add embed-directive example and rename embedding to struct-embedding

Signed-off-by: peterzhu1992 <peterzhu1992@gmail.com>

* Minor tweaks

Signed-off-by: peterzhu1992 <peterzhu1992@gmail.com>

* Add some improvements

Signed-off-by: peterzhu1992 <peterzhu1992@gmail.com>

* Add isDir() checks for measure.go and generate.go in tools

Signed-off-by: peterzhu1992 <peterzhu1992@gmail.com>
2022-05-24 05:31:13 -07:00
peterzhu1992
a19c5b87e6
Rename embedding to struct embedding to be separated from //go:embed directive (#424)
Signed-off-by: peterzhu1992 <peterzhu1992@gmail.com>
2022-05-17 10:59:35 -07:00
Hayden B
ac01d2d4bb
Update SHA1 example to SHA256 (#418)
This encourages the use of stronger cryptographic hashes. Tools such as
securego/gosec will show errors when SHA1/MD5 hashes are used.
2022-03-31 05:41:58 -07:00
Eli Bendersky
881bb5d41c Remove collection-functions
Now that we have generics, this example is not relevant.

Updates #349
2022-03-15 10:56:14 -07:00
Eli Bendersky
3c2447b2d1
Add example of Go generics (#415)
* Add example of Go generics

Fixes #349

* Remove TODO

* Update public link

* Update GitHub action to only build with 1.18-rc1

1.17 won't successfully build the generics example
2022-03-15 10:53:49 -07:00
Eli Bendersky
1fa5cff95c Reorder examples slightly
Text Templates should come right after String Formatting
2022-02-11 06:19:37 -08:00
Arash Sameni
ccfd710f2b
Templates: added comments, output and listed in examples (#413) 2022-02-10 12:46:38 -08:00
Eli Bendersky
b2057ccfd2 strings-and-runes: added comments, output and listed in examples 2022-02-05 07:08:26 -08:00
Eli Bendersky
061b2f6455 Rename testing --> testing-and-benchmarking 2021-12-02 07:12:23 -08:00
Eli Bendersky
35ad9cc35c Add example of struct embedding in Go
Also mention implementing interfaces with embedding

Fixes #381
Fixes #398
2021-11-22 12:48:11 -08:00
Eli Bendersky
b4568f3025 Refactor page footer to separate template
Fixes #387
2021-09-02 10:26:17 -07:00
Eli Bendersky
91c8ceec2c Adding a new example: recover
With thanks to @LaryBattle for the discussion in #46 and
@kilaka for the discussion in #344.

Fixes #46
Closes #344
2021-09-01 08:51:00 -07:00
Eli Bendersky
7a5cb99b84
Add myself to footer (#386)
* Add myself to footer

* Add myself to the example template as well, and rebuild
2021-08-26 15:50:29 -07:00
Hana
c8b3ae78dd templates: recommend the Go getting started doc
This isn't strictly necessary to work with the
examples from this tutorial, but knowing the
latest behavior of the go toolchain will be helpful
when users start to extend the examples.
2021-02-15 17:56:40 -05:00
Hana
9e216da9ef go.mod: add go.mod and move pygments to third_party
After go1.16, go will use module mode by default,
even when the repository is checked out under GOPATH
or in a one-off directory. Add go.mod, go.sum to keep
this repo buildable without opting out of the module
mode.

> go mod init github.com/mmcgrana/gobyexample
> go mod tidy
> go mod vendor

In module mode, the 'vendor' directory is special
and its contents will be actively maintained by the
go command. pygments aren't the dependency the go will
know about, so it will delete the contents from vendor
directory. Move it to `third_party` directory now.

And, vendor the blackfriday package.

Note: the tutorial contents are not affected by the
change in go1.16 because all the examples in this
tutorial ask users to run the go command with the
explicit list of files to be compiled (e.g.
`go run hello-world.go` or `go build command-line-arguments.go`).
When the source list is provided, the go command does
not have to compute the build list and whether it's
running in GOPATH mode or module mode becomes irrelevant.
2021-02-15 16:45:26 -05:00
Mark McGranaghan
df99089b9f Rename to shorter context 2020-01-04 09:50:52 -08:00
Eli Bendersky
fa91799164 Reformat comoments to flow better with the code 2019-11-19 06:41:40 -08:00
Eli Bendersky
be9b84288c Add a new example: testing 2019-09-12 11:30:07 -07:00
Eli Bendersky
c715a7efc0 Complete the example text, add .sh and generate page 2019-09-01 16:13:01 -07:00
Mark McGranaghan
1097f13d1f Adjust ordering per GitHhub PR 2019-06-30 13:59:01 -07:00
Eli Bendersky
8219122e44 Temporary files and directories sample
Followup on discussion in #243
2019-06-30 13:57:05 -07:00
Eli Bendersky
447d77234f Add directories example 2019-06-08 06:11:13 -07:00
Eli Bendersky
52be303a71 File Paths example 2019-06-06 06:17:45 -07:00
Eli Bendersky
973da6773f HTTP servers sample 2019-06-04 07:44:39 -07:00
Eli Bendersky
738fc184ef Subcommands example 2019-06-04 05:48:59 -07:00
Eli Bendersky
dfcaebd536 Basic HTTP client sample 2019-05-31 12:08:57 -07:00
Mark McGranaghan
616ddedf59 Build for GA removal 2019-05-30 06:55:38 -07:00
Eli Bendersky
ec0b192e48 Rename waitgroup-->waitgroups 2019-05-30 06:12:09 -07:00
Eli Bendersky
74ca2a7b0f Addressing review comments
* Renamed the example
* Reworded comments
* Moved it to after worker pools
* Sleep for a second instead of random
* Mention the new sample in worker pools
2019-05-30 05:28:29 -07:00
Eli Bendersky
6ab81bdf71 Add "Waiting For Goroutines To Finish" example.
Also link to it from the Channel Synchronization example
2019-05-29 06:01:58 -07:00
Mark McGranaghan
cdd115dfc8 Update author links 2019-03-20 11:28:21 -07:00
Mark McGranaghan
2835629767 Rebuild to reflect meta change 2015-09-14 08:50:18 -07:00
cara marie
1c13d744fd Corrected broken 'first example' link. 2014-04-08 20:31:47 -07:00
Mark McGranaghan
6da8afaa7c Change Twitter link 2013-11-17 08:43:04 -08:00
Mark McGranaghan
72b227694f first pass at import 2012-11-17 07:08:12 -08:00