Go programming language
Go programming language
? history
? basic constructs
? simple programs
? arrays & slices
? maps
? methods, interfaces
? concurrency, goroutines
Go source materials
? official web site:
? Go tutorial, playground
? Rob Pike on why it is the way it is:
? Russ Cox on interfaces, reflection, concurrency
Hello world in Go
package main!
import "fmt"!
func main() {!
fmt.Println("Hello, ÊÀ½ç")!
}!
$ go run hello.go
$ go build hello.go
# to compile and run!
# to create a binary!
$ go help
# for more!
Types, constants, variables
? basic types
bool string int8 int16 int32 int64 uint8 ¡
float32 float64 complex64 complex128!
quotes: ¡®ÊÀ¡¯, ¡°UTF-8 string¡±, `raw string`!
int
uint!
? variables
var x, y, z = 0, 1.23, false
// variable decls!
x := 0; y := 1.23; z := false // short variable decl!
Go infers the type from the initializer
¨C assignment between items of different type requires an explicit
conversion, e.g., int(float_expression)
? operators
¨C mostly like C, but ++ and -- are postfix only and not expressions
¨C assignment is not an expression
Echo command:
// Echo prints its command-line arguments.!
package main!
import (!
!"fmt"!
!"os"!
)!
func main() {!
var s, sep string!
for i := 1; i < len(os.Args); i++ {!
!
!s += sep + os.Args[i]!
!
!sep = " "!
}!
fmt.Println(s)!
}!
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- golang template array join
- golang string concatenation tutorial kart
- modernizing desktop linux development
- strip in python example
- declare array of maps
- avro schema to golang struct
- add elements to array after declaring it
- golang declare variable in for loop
- notice array to string conversion in php
- go go gadget go lang
Related searches
- java programming language book pdf
- the java programming language pdf
- java programming language tutorial pdf
- java programming language pdf download
- java programming language for beginners
- c programming language standard
- c programming language specification
- programming language popularity
- best programming language for games
- which programming language to learn first
- best programming language to learn 2020
- simple programming language for beginners