Please enable JavaScript.
Coggle requires JavaScript to display documents.
GoLang (Environment (src/bin/pkg folders?, GOPATH - path to look up…
GoLang
-
-
Functions
Multiple returns: return a, err
-
-
-
-
-
-
-
-
-
-
Benchmarking
go test -bench
go test -bench . string_test.go
go test -bench . -benchmem string_test.go
go test -bench . -benchmem -cpuprofile=cpu.out -memprofile=mem.out -memprofilerate=1 string_test.go
go tool pprof main.test cpu.out
go tool pprof main.test mem.out
-
Synchronization
-
mutex - mutual exclusion (full, RW)
-
-
-
-
-
-
-
-
Strict typing
Types
-
-
-
Interface
-
-
-
No explicit declaration (duck typing, check if has method/prop)
-
-
-
-
-
-
Zero value = type default value.
int = 0, string = "", bool = false, array = def values of type, other* = nil
val, ok := x.(type) - get like a type (type assertion).
SPECIFIC_TYPE(x) - casting
-
Reflection - work with metadata about var as with object (type, value, fields)
-
-