Eli Bendersky
25d2811293
Remove unused code
2022-05-25 20:59:29 -07:00
Eli Bendersky
d9439333fe
Clean up template rendering code
...
Use template.Must(...) to simplify code
defer close the files we open
2022-05-25 20:54:05 -07:00
Eli Bendersky
625ea8043e
Render 404 page with templates to reuse the footer
2022-05-25 20:41:46 -07:00
Eli Bendersky
36464854b9
Rebuild to have updated index.html in public/
2022-05-24 20:22:13 -07:00
Eli Bendersky
52fd882fcf
Update golang.org links to point directly to go.dev
...
The golang.org links have been redirecting to go.dev for a while - make
direct links.
2022-05-24 20:17:37 -07:00
Eli Bendersky
5f2ab6c8a2
More comment tweaks to the new embed-directive
2022-05-24 06:28:18 -07:00
Eli Bendersky
fc88db1814
Fix up embed-directive example and rename files to be shorter
2022-05-24 06:11:22 -07:00
Eli Bendersky
d4bbdc258b
Reformat tools/ files
2022-05-24 05:44:45 -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
Eli Bendersky
9deadb76ae
Improve spawning-process example with error-checking
2022-05-06 10:16:02 -07:00
Eli Bendersky
6b91c38bb3
Rebuild embedding example and publish public/
...
Closes #420
2022-05-02 10:30:17 -07:00
Eli Bendersky
e6c5a8fb2f
Fix typo in embedding example's comment
...
Based on #420 by @smottt
2022-05-02 10:29:44 -07:00
Eli Bendersky
ed7a093662
Clean up description in SHA256 example
2022-03-31 05:45:19 -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
e6da67918c
Update GH actions workflow badge in README
2022-03-17 13:58:27 -07:00
Eli Bendersky
1eba71e8f3
Set go-version to 1.18.0 in the builder ( #416 )
2022-03-15 20:02:06 -07:00
Eli Bendersky
9a8d0aa5da
Remove collection-functions from public/ as well
2022-03-15 10:58:15 -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
5c36a19ea8
Try rc1 1.18 version for go testing
2022-03-14 05:52:39 -07:00
Eli Bendersky
1fa5cff95c
Reorder examples slightly
...
Text Templates should come right after String Formatting
2022-02-11 06:19:37 -08:00
Eli Bendersky
0751f43b3a
Round of fixes for the new text-template example
...
Making it a bit cleaner and easier to understand
2022-02-10 13:54:06 -08:00
Arash Sameni
ccfd710f2b
Templates: added comments, output and listed in examples ( #413 )
2022-02-10 12:46:38 -08:00
Eli Bendersky
5fa0d40cdb
Re-generate output after #414
2022-02-10 05:27:34 -08:00
Konstantin Kovshenin
0f801fd5f3
Fix typo in strings-and-runes ( #414 )
2022-02-10 05:25:18 -08:00
Eli Bendersky
3e51f69fb5
Merge branch 'master' of github.com:mmcgrana/gobyexample
2022-02-05 07:23:25 -08:00
Eli Bendersky
2c7b384669
Clean up last printout in string-functions
...
It's unnecessary now
2022-02-05 07:22:56 -08:00
Eli Bendersky
35018ab3c9
Update README.md
2022-02-05 07:20:06 -08:00
Eli Bendersky
e604254e38
Tweaks to other samples to accommodate strings-and-runes
...
Add a link to the range sample, and remove partial mentions of this
topic in string-functions since it's now covered well in
strings-and-runes
2022-02-05 07:11:37 -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
ff399c7001
Starting a strings-runes example
...
For now just the code, no output, no comments
For #411
2022-02-04 16:49:44 -08:00
Eli Bendersky
2885fc2298
Move around commend in recursion sample for better rendering
...
This way the commend renders next to the right code block
2022-01-28 09:26:30 -08:00
Eli Bendersky
57ac312e30
Update README.md
2022-01-10 05:52:57 -08:00
Eli Bendersky
364f0c2f69
Run CI on latest version of Go only
2022-01-10 05:48:21 -08:00
Eli Bendersky
63ed62348e
Slight comment rewording following the previous commit
2022-01-10 05:45:35 -08:00
Sandeep
1c7180a00f
Update Epoch
example to add UnixMilli from Time package ( #409 )
...
Standard library time package has support for UnixMilli - https://pkg.go.dev/time#Time.UnixMilli
Updated the example to use the method on Time instead of calculating.
2022-01-10 05:42:31 -08:00
Eli Bendersky
668ecb9732
Add brief FAQ section in the README to clarify common questions
2021-12-16 20:16:44 -08:00
Eli Bendersky
3397ebcf08
Remove old public/testing, since the source was renamed
2021-12-02 07:13:06 -08:00
Eli Bendersky
061b2f6455
Rename testing --> testing-and-benchmarking
2021-12-02 07:12:23 -08:00
Eli Bendersky
99902be3b2
Slightly tweak comments after #403
2021-12-02 07:09:23 -08:00
Johanan Idicula
dadb6bdeae
feat: Add benchmark example ( #403 )
...
* feat: Add benchmark example
Adds a simple benchmark example and its invocation.
* fix: Address PR comments
- Clarify meaning of `b.N`.
- Nix verbose flag in run example.
* fix: Reword b.N comment
* fix: Missing period
2021-12-02 07:04:59 -08:00
Eli Bendersky
80fb5ebddf
Clarify the signals example slightly
...
Based on feedback in #402
2021-12-02 06:31:37 -08:00
Adrien Lacquemant
dad9113134
Fix incorrect link in README.md ( #404 )
2021-12-01 14:52:32 -08:00
Eli Bendersky
c93e7c1cf8
Generate public/* for mutex
2021-11-22 12:53:10 -08:00
Nate Finch
2621c73d29
don't embed the mutex ( #400 )
...
Do not embed the mutex in the mutex example
2021-11-22 12:51:49 -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
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