Skip to content

Files

Latest commit

 

History

History
61 lines (22 loc) · 4.18 KB

go-in-action.md

File metadata and controls

61 lines (22 loc) · 4.18 KB

Go in Action

> Home

Chapter 2. Go quick-start

On line 20, we use the built-in function make to create an unbuffered channel. (link)

slice is a reference type that implements a dynamic array. (link)

In Go, all variables are initialized to their zero value. For numeric types, that value is 0; for strings it’s an empty string; for Booleans it’s false; and for pointers, the zero value is nil. (link)

In Go, identifiers are either exported or unexported from a package. (link)

The compiler will always look for the packages you import at the locations referenced by the GOROOT and GOPATH environment variables (link)

This is a technique in Go to allow initialization from a package to occur, even if you don’t directly use any identifiers from the package. (link)

Chapter 1. Introducing Go

In contrast, a Go interface typically represents just a single action (link)

Interfaces allow you to express the behavior of a type. (link)

Inheritance versus composition (link)

Go developers simply embed types to reuse functionality in a design pattern called composition (link)

Go provides a flexible hierarchy-free type system that enables code reuse with minimal refactoring overhead. (link)

Channels are data structures that enable safe data communication between goroutines. (link)

As stated before, goroutines have minimal overhead, so it isn’t uncommon to spawn tens of thousands of them (link)

The trade-off is that dynamic languages don’t offer the type safety that static languages do and often need a comprehensive test suite to avoid discovering incorrect type bugs at runtime. (link)

When you build a Go program, the compiler only needs to look at the libraries that you directly include, rather than traversing the dependencies of all the libraries that are included in the entire dependency chain like Java, C, and C++. (link)

Because of Go’s built-in concurrency features, your software will scale to use the resources available without forcing you to use special threading libraries. (link)

Go rethinks the traditional object-oriented development you might be used to, while still providing an efficient means for code reuse (link)

> Home