Commit Graph

48 Commits

Author SHA1 Message Date
Kev Choi
f63032d2f2 Add default case to switch statement in Go 2015-04-20 23:26:38 -07:00
kb
5e5a7a19fe [go] Fix no new variables on left side of :=
Cannot short declaration twice without at least one new var.  Also changing type from string to slice.

$ go run learnxiny.go
# command-line-arguments
./learnxiny.go:83: no new variables on left side of :=
./learnxiny.go:83: cannot use []int literal (type []int) as type string in assignment
./learnxiny.go:84: first argument to append must be slice; have string
./learnxiny.go:90: first argument to append must be slice; have string
2014-09-22 12:11:49 +00:00
Levi Bostian
291f6f6b22 Fix "initialized" typo. 2014-09-05 21:02:38 -05:00
Levi Bostian
1fb4886020 Merge pull request #703 from jcbohin/go-en-confusing_array_initialization-#257
[go/en] Array initialization disambiguation - fixes #257
2014-09-05 21:01:38 -05:00
Nami-Doc
0846eaa0e7 EDOUBLEDSPACE
My *fake* ocd kicked in
2014-09-05 15:05:13 +02:00
Sam Zaydel
161e19baa9 Minor language change fixing mixed use of array and slice, where only slice is correct. 2014-08-19 20:43:42 -07:00
Sam Zaydel
7000db24e0 Fixed indentation error created in previous commit. 2014-08-19 20:43:42 -07:00
Sam Zaydel
a7a8c85257 In golang slices are dynamic, so a mention of append() for slice updates seems to be appropriate. 2014-08-19 20:43:42 -07:00
James Baxter
d7ead48d1f Corrected the statement that rune is an alias for uint32 to say int32 2014-08-19 12:06:02 +01:00
Nami-Doc
e1982bf586 Merge pull request #707 from jcbohin/patch-1
[go/en] Adding Go playground link with code - fixes #318
2014-08-08 10:50:01 +02:00
Jean-Christophe Bohin
26166afc65 Fixed style
Didn't uppercased 'range' in the beginning of the sentence since it's a language keyword.
2014-08-07 22:43:59 +02:00
Jean-Christophe Bohin
c0d49cdb88 Fixing missing space and dot. 2014-08-07 22:37:52 +02:00
Jean-Christophe Bohin
a4b4a7927f Adding a direct link to play.golang.org 2014-08-07 22:31:20 +02:00
Jean-Christophe Bohin
2ffd792932 Adding Go playground link with code - fixes #318
Just removed networking code, since Go playground's sandbox prevent it to work.
2014-08-05 09:03:21 +02:00
Jean-Christophe Bohin
0078b03707 Array initialization disambiguation - fixes #257
simply added proposed comment, which seems fine
2014-08-04 22:38:53 +02:00
Jean-Christophe Bohin
cfa26f23fd [go/en] add an example for range - fixes #351 2014-08-04 22:23:24 +02:00
Hey Alexej
c022e2e857 fix import of io/ioutil, run gofmt
generated/downloaded file doesn't work with "go run". it's missing ioutil.
ran gofmt which uses tabs (width=8) for formatting. longest line is 85
characters now. removed whitespace.
2014-07-16 05:28:50 +07:00
Levi Bostian
36dae81010 Merge pull request #671 from szaydel/master
Function literals used inline in Go language
2014-07-10 23:42:41 -05:00
Sam Zaydel
7cddab2925 Forgot to add => to comment line. 2014-07-10 09:25:48 -07:00
Sam Zaydel
174f0baa14 Small change to inline literal functions comments. 2014-07-10 09:22:47 -07:00
Sam Zaydel
55e1c2adaf Go inline function literals as arguments to other functions or function literals. 2014-07-09 20:56:01 -07:00
Pete Hamilton
4c34096703 Remove duplication of function factory example 2014-07-05 12:03:09 +01:00
Levi Bostian
09459a25fe Merge pull request #663 from vvo/patch-2
feat(webserver request): add a http.Get example
2014-07-02 08:57:54 -05:00
Vincent Voyer
f2e3d99476 feat(webserver request): add a http.Get example
1. script now exits
2. we initiate a request to the started server to prove the serverHTTP works

what do you think?
2014-07-02 14:55:33 +02:00
Vincent Voyer
74c0a49e6d fix(go func factory): fix func factory example
previous code did not run because outside main() code was done
2014-07-02 14:37:15 +02:00
Sam Zaydel
8b6920a70a Learn function decorators with Go
Added snippet about using closures as function decorators in Go. Also
removed a few extra whitespaces.
2014-06-29 08:12:58 -07:00
Sam Zaydel
e881ba74f3 Hopefully slight language improvement over orig. 2014-06-23 07:31:39 -07:00
Sam Zaydel
9448404709 Slight language change per pull req. comment 2014-06-22 20:49:29 -07:00
Sam Zaydel
ff49deb886 Fixed on to in in comment. 2014-06-22 06:21:21 -07:00
Sam Zaydel
e5d8895c8e Should have more detail about named return values.
There was not a section about named return values, and it feels like it is a valuable and important enough thing to learn early on. If nothing else, when looking at someone else's code this may be a point of confusion.
2014-06-22 06:20:12 -07:00
Jose Donizetti
163d97c162 [go/en] add range index explication, and new learn source 2014-05-11 16:33:08 -04:00
Qumeric
07b229a425 Fix Go tutorial, especially ru translation 2014-04-16 18:06:58 +04:00
Quint Guvernator
ded11e254f added defer example
decided not to use file i/o as an example because external file access
is rare in other tutorials.
2014-02-02 15:11:15 -05:00
Jesse Johnson
2655b4d056 [go/en] Fix veriadic function bug; format and clarify comments. 2014-01-30 18:50:05 -05:00
C. Bess
863194a89a - add variadic function example 2014-01-24 15:30:15 -06:00
Adam
6172fee1a4 Merge branch 'master' of https://github.com/adambard/learnxinyminutes-docs 2013-09-08 21:52:54 -07:00
Adam
a933d419e0 Some fixes 2013-09-08 21:52:47 -07:00
Matthew Wyatt
febe5f4994 Added links to source and package documentation.
Also reformatted line lengths to accommdate links.
2013-09-04 20:46:45 -07:00
Adam Bard
bf15cd5aa4 Merge pull request #300 from JensRantil/parentheses-fix
parens => parentheses
2013-09-04 09:27:11 -07:00
Adam Bard
7694dddf06 Merge pull request #305 from mrshu/master
chan chan string -> channel of string channels
2013-09-04 09:07:42 -07:00
Adam Bard
a9880277b2 Merge pull request #307 from NKCSS/master
Changed Print function to show the variable type
2013-09-04 09:06:37 -07:00
Harry Jeffery
078f6bbc9d Corrected comment: utf-8 → unicode
Runes hold the raw unicode code point, not utf-8. Storing utf-8 inside of a uint32 would be highly inefficient. Runes are essentially utf-32.
2013-09-04 13:39:02 +01:00
NKCSS
284f1ea407 Changed Print function to show the variable type
This is to follow the way the string value is presented, and the format
string is written (... is a ... infers a stype specification)
2013-09-04 11:52:57 +02:00
Marek Šuppa
abb903caba chan chan string -> channel of string channels 2013-09-04 11:30:50 +02:00
Jens Rantil
dde956286a parens => parentheses 2013-09-04 09:37:26 +02:00
Adam
4d705abd99 Piddly things 2013-08-13 19:59:19 -07:00
Sonia Keys
a73d5c83c1 slashed comments 2013-08-13 17:12:54 -04:00
Sonia Keys
de6069d3d6 Go first draft 2013-08-13 13:52:13 -04:00