1122 Commits

Author SHA1 Message Date
Eli Bendersky
f09cadcbd9 Change mutexes example to make it simpler and more predictable
Fixes #364
2021-10-30 06:20:02 -07:00
Eli Bendersky
e10011f90f Rebuild example to public after previous PR's change 2021-09-20 06:38:52 -07:00
Gautam Kotian
15c92ee528
Minor fixes (#396)
* Add missing word

* Rename `boolPtr` to `forkPtr`

This is in order to be consistent with the other flags `wordPtr` &
`numbPtr` which are based on the name of the flag and not the type of
the flag.
2021-09-20 06:37:55 -07:00
Eli Bendersky
eac6776159 Clarify comment
Remove an ambiguous part of the comment that can cause confusion -
passing a WaitGroup by pointer is always mandatory.
2021-09-10 07:19:33 -07:00
Eli Bendersky
8367c3ee2c Update .gitattributes
We no longer have a `vendor` folder.
Make public/** matching stronger
2021-09-10 06:35:31 -07:00
Eli Bendersky
b1ef499821 Rewrite the WaitGroup example to be more idiomatic
A wrapper closure invokes wg.Done

Still mention the pass-by-pointer requirements on the WaitGroup

Fixes #278
2021-09-10 06:11:56 -07:00
Eli Bendersky
4de485a514 Add partial prefixes in some places to regular-expressions
See #394 for details.

This closes #288 by providing a lighter-weight approach.
2021-09-10 05:56:40 -07:00
Eli Bendersky
2570a9c136 Remove old Ruby-based upload script
The new Go-based code works fine and has successfully uploaded the site
several times now. This removes a dependency on a non-Go flow which
should make development easier.
2021-09-08 05:49:47 -07:00
Eli Bendersky
cf0d050e81 Rename some string formatting outputs
Also rebuild output
2021-09-08 05:46:23 -07:00
V. K
33985af4da
Added prefixes with purpose to find output result easier. (#391) 2021-09-08 05:42:31 -07:00
Eli Bendersky
2e6a5ad8c9 Clarify the comment on the recursion example
More than one example in it now
2021-09-02 10:40:04 -07:00
Eli Bendersky
b4568f3025 Refactor page footer to separate template
Fixes #387
2021-09-02 10:26:17 -07:00
Eli Bendersky
68cc690ca4 Add a wrapper script for tools/upload.go
The script sets up the -region and -bucket flags to point to the right S3
location. AWS_* env vars should still be set manually.

The old Ruby uploading code is moved to upload-ruby-old for now (will be
deleted later)
2021-09-02 06:42:17 -07:00
Eli Bendersky
198349f683 Add comments and clean up code 2021-09-02 06:40:02 -07:00
Eli Bendersky
364c664211 Initial version of the Go uploader to S3
It works using a test bucket
2021-09-02 06:19:19 -07:00
Eli Bendersky
d037acd3e6 Update Recursion example to demonstrate recursive closures
Fixes #389
2021-09-02 05:53:30 -07:00
Eli Bendersky
2acace92c0 Clarify the panic example with a comment about unreachable code
Fixes #390
2021-09-02 05:42:07 -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
5525fed5ae Remove Travis and fix badge link in README 2021-08-31 06:28:21 -07:00
Eli Bendersky
95a10027c6
Create initial GitHub actions workflow 2021-08-31 06:23:50 -07:00
Eli Bendersky
69efd4b8c0 Add note to waitgroups example about errgroup
Fixes #308
2021-08-30 09:18:16 -07:00
Eli Bendersky
df8a378a22 Remove outdated link from an example
gobyexample doesn't use pygments anymore, so the generate program doesn't
spawn anything.
2021-08-30 07:24:48 -07:00
Eli Bendersky
a9507f5bbb
Clarify comment for the goroutines sample (#366)
* Clarify comment for the goroutines sample.

The current comment may be interpreted to say that the output must be
interleaved, when in fact it doesn't have to be (it depends on the order
the goroutines are run). Make the comment more permissive to avoid the
confusion.

Fixes #365

* Fix phrasing in comment
2021-08-30 07:17:25 -07:00
Eli Bendersky
ac94809b64
Replace deprecated ioutil functions with others (#374)
* Remove use of deprecated ioutil functions from examples

* Remove usage of ioutil from gobyexample's own scripts

+ regenerate output
2021-08-28 06:38:35 -07:00
Mark McGranaghan
952453859f
Update Travis badge Markdown per Travis app (#388) 2021-08-27 17:48:41 -07:00
Eli Bendersky
eb450ec740 Add public/404.html as generated in the previous commit 2021-08-27 16:46:20 -07:00
Blake Bourque
c5ee569a42
Fix typo in meta tag attribute (#376) 2021-08-27 16:42:01 -07:00
Eli Bendersky
8627d854d9
Test with both Go 1.17 and 1.16 (#385)
This is in line with the Go support policy of current version + previous version
2021-08-27 16:41:04 -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
Blake Bourque
58e66a8103
Use chroma (#346)
Use Chroma for syntax highlighting and remove vendor'd Pygments
2021-02-27 06:30:00 -08:00
Eli Bendersky
81ab859a7b
Upgrade blackfriday to v2 and fix underscore italics (#350)
Now that we have a go.mod, we can properly upgrade to blackfriday/v2

The output remains the same, but this PR brings back italic links with '_',
placing them into the link since this seems to be the more proper way.

Fixes #182
2021-02-20 10:22:23 -08:00
Mark McGranaghan
fff24f8bc7 Rebuild for typo fix 2021-02-19 13:17:41 -08:00
Mark McGranaghan
b76ff6c413 Merge branch 'yurivish-patch-1' 2021-02-19 13:17:29 -08:00
Yuri
1ecc5bfc61 Fix a typo 2021-02-19 13:16:37 -08:00
Hana
e39e6f194c remove unnecessary go get 2021-02-19 13:41:18 -05:00
Hana
fb4e31bd28 Revert "LICENSE: add CC-BY-3.0 license"
This reverts commit fcd052ee008b90e28d95cded1313034443013d34.
2021-02-19 13:29:45 -05:00
Hana
7f736682ff .travis.yml: update to go1.15
Soon this needs to be updated to go1.16
2021-02-16 13:34:48 -05:00
Hana
fcd052ee00 LICENSE: add CC-BY-3.0 license
Copied from
https://creativecommons.org/licenses/by/3.0/legalcode.txt

pkg.go.dev (godoc.org) is not presenting this project
because of the missing license info. See their license
policy https://pkg.go.dev/license-policy
2021-02-15 17:56:44 -05: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
f72f11e641 Rebuild 2020-10-19 08:04:08 -07:00
Mark McGranaghan
1e3ec28f70
Merge pull request #342 from legonian/patch-1
Change t.Fail to t.Fatal
2020-10-19 08:01:29 -07:00
legonian
71719ea0f3
Change t.Fail to t.Fatal
Fail* continues execution, right function probably Fatal*.
2020-10-18 14:34:13 +03:00
Mark McGranaghan
7d87b1b9f0 Rebuild 2020-08-23 07:50:27 -07:00
Mark McGranaghan
25cf6d9e69 Merge branch 'szTheory-patch-1' 2020-08-23 07:47:43 -07:00
szTheory
7823e44fc9
Update timeouts.go: Fix typo 2020-06-13 12:42:00 +00:00
Mark McGranaghan
448c597a58 Regenerate 2020-04-10 18:06:38 -07:00
Mark McGranaghan
ce206e9c31 Try updating Go in Travis 2020-04-10 18:01:39 -07:00
Mark McGranaghan
c49161f615 Merge branch 'gregimba-grammar-fix' 2020-04-10 18:00:26 -07:00
Mark McGranaghan
15264d99c4 Merge branch 'grammar-fix' of https://github.com/gregimba/gobyexample into gregimba-grammar-fix 2020-04-10 18:00:08 -07:00