diff options
author | AlburIvan <albur.ivan@outlook.com> | 2018-10-28 03:00:26 -0400 |
---|---|---|
committer | AlburIvan <albur.ivan@outlook.com> | 2018-10-28 03:00:26 -0400 |
commit | df0a0fa2a6ea1b818e3c6aaa139f77fde41f0256 (patch) | |
tree | c912eebef5bf5bfd45d4c2b6c91f355157041de8 /go.html.markdown | |
parent | 73b8cd9a39ab9b63dd5e2c1c123c363fd014753a (diff) | |
parent | 27fa7c50ce23def736a69711f827918acc726e37 (diff) |
Merge branch 'master' of github.com:adambard/learnxinyminutes-docs into matlab-es
Diffstat (limited to 'go.html.markdown')
-rw-r--r-- | go.html.markdown | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/go.html.markdown b/go.html.markdown index e5263cf6..ae99535b 100644 --- a/go.html.markdown +++ b/go.html.markdown @@ -15,15 +15,15 @@ contributors: --- Go was created out of the need to get work done. It's not the latest trend -in computer science, but it is the newest fastest way to solve real-world +in programming language theory, but it is a way to solve real-world problems. -It has familiar concepts of imperative languages with static typing. +It draws concepts from imperative languages with static typing. It's fast to compile and fast to execute, it adds easy-to-understand -concurrency to leverage today's multi-core CPUs, and has features to -help with large-scale programming. +concurrency because multi-core CPUs are now common, and it's used successfully +in large codebases (~100 million loc at Google, Inc.). -Go comes with a great standard library and an enthusiastic community. +Go comes with a good standard library and a sizeable community. ```go // Single line comment @@ -48,7 +48,7 @@ import ( // executable program. Love it or hate it, Go uses brace brackets. func main() { // Println outputs a line to stdout. - // Qualify it with the package name, fmt. + // It comes from the package fmt. fmt.Println("Hello world!") // Call another function within this package. @@ -180,7 +180,7 @@ func learnFlowControl() { if true { fmt.Println("told ya") } - // Formatting is standardized by the command line command "go fmt." + // Formatting is standardized by the command line command "go fmt". if false { // Pout. } else { @@ -277,7 +277,8 @@ func sentenceFactory(mystring string) func(before, after string) string { } func learnDefer() (ok bool) { - // Deferred statements are executed just before the function returns. + // A defer statement pushes a function call onto a list. The list of saved + // calls is executed AFTER the surrounding function returns. defer fmt.Println("deferred statements execute in reverse (LIFO) order.") defer fmt.Println("\nThis line is being printed first because") // Defer is commonly used to close a file, so the function closing the |