Eli Bendersky
d51586e6bf
Add example of the new clear() builtin for maps in 1.21
...
updates #481
Also bump go.mod to 1.21
2023-08-21 06:15:47 -07:00
Eli Bendersky
1ee3369f02
Add link from structs-->testing-and-benchmarking
2023-06-05 13:42:02 -07:00
Eli Bendersky
ef81b2a729
Fix typo in a comment
...
This was suggeste in #477 by @mnm364
Fixes #477
2023-06-05 05:48:59 -07:00
Eli Bendersky
6bd7615366
Reword comment in new anon struct sample
2023-06-05 05:47:05 -07:00
Hossein Naghdbishi
4b9411514f
Introduce anonymous structs ( #474 )
2023-06-05 05:40:49 -07:00
Eli Bendersky
1512fb0094
slices: tweak the recent changes for clarity and grammar
2023-05-16 11:10:16 -07:00
jiangbo
fd4d72bccf
add unassigned slice example ( #475 )
2023-05-16 11:04:20 -07:00
Hossein Naghdbishi
363849f9e3
link embed directive ( #469 )
2023-04-19 16:25:27 -07:00
Eli Bendersky
0812429584
Clarify zero value for map values when keys don't exist
2023-03-20 05:59:53 -07:00
siiky
38eb2236ca
dependes
-> depends
(#462 )
2023-02-03 16:36:22 -08:00
Grejo Joby
4944c3bc7b
Added more information about shorthand variable declaration ( #457 )
2022-12-20 12:53:58 -08:00
Javier Pacareu
30a235b655
docs: remove typo ( #454 )
...
* docs: remove typo
* Update mutexes.go
* feat: add changes
Co-authored-by: Javier Pacareu <jpacareu.meli@gmail.com>
2022-12-12 06:21:16 -08:00
Eli Bendersky
bc9700aab3
Add missing $ go run ...
line on top of generics.sh
...
Fixes #452
2022-11-03 06:03:54 -07:00
Eli Bendersky
0650d74678
Slight rewording
2022-10-25 06:02:53 -07:00
Aditya Sood
9ba0fd08de
Minor addition to if-else text on declarations ( #450 )
...
* Minor addition to if-else text on declarations
Extremely minor addition to if-else text on declarations preceding conditionals, by explicitly clarifying that variables declared are only available in branches succeeding the declaration, not all the branches in the if-else ladder (i.e. preceding branches will not have it in their scope)
This edit might be redundant since variables in Golang can only be used after declaration, but to a complete novice the original wording of "...any variables declared in this statement are available in *all* branches..." might be a little misleading and appear to say that the variable is in-scope for the preceding branches as well (as this seems to be a very Golang-specific semantic that other high-level languages like C/C++, Java, Scala, Kotlin etc don't support; and so it will be a brand new paradigm for developers coming from such languages).
Thanks!
* Increment: Include changes in source .go file for #450
2022-10-25 06:00:36 -07:00
Naoya Ueda
c40fcde81f
Add missing command line example for recover.sh ( #444 )
2022-09-23 06:12:58 -07:00
Eli Bendersky
840541a6bd
Rename http clients/servers to singular language: client/server
2022-09-22 13:44:25 -07:00
Eli Bendersky
cc804d764b
Clarify determinism of Go playground w.r.t. random numbers
...
Fixes #443
2022-09-22 07:05:32 -07:00
Eli Bendersky
b4f289fe92
Adjust for gofmt changes in 1.19
...
In 1.19, gofmt slightly changes how comments are formatted; a blank `//` is
inserted before `//go:embed` directives.
To accommodate for that in generate.go, treat empty comment lines as
part of docs segments.
2022-09-08 05:55:05 -07:00
Eli Bendersky
742fab3f1c
Clarify slices vs. arrays a bit
...
Highlight slices in the opening description of the arrays example, to
grab attention of new users
2022-09-08 05:37:20 -07:00
Andreas Sommer
1b4dac72d3
Mention that environment variable set by program is also listed by os.Environ()
( #436 )
...
Co-authored-by: Andreas Sommer <andreas.sommer@ppro.com>
2022-08-22 05:59:10 -07:00
Ben McNicholl
73cd7a73bb
Fix typo in Println statement ( #432 )
...
* Fix typo in Println statement
* Generate HTML for public files.
2022-07-11 05:42:26 -07:00
Eli Bendersky
0eaaca29ef
Fix typo in xml example
...
This was noticed by @deining in #428
Closes #428
2022-06-27 20:48:50 -07:00
Eli Bendersky
f197dfc6e1
Clarify the type of variadic params with a comment
2022-06-24 12:43:35 -07:00
Ashish Gaur
c662818d23
Changes 'the' to 'then' in stateful goroutine example ( #427 )
...
* Changes 'the' to 'then' in stateful goroutine example
* Run tools/build to update HTML
2022-06-07 05:23:40 -07:00
Andreas Deininger
da13e2fbe7
Improving links (http -> https) ( #425 )
2022-06-06 11:31:46 -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
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
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
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
2c7b384669
Clean up last printout in string-functions
...
It's unnecessary now
2022-02-05 07:22:56 -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
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
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