Let's Learn Go
Let's Learn Go -- (6) Interface
· ☕ 5 min read
1. Interface-Oriented Programming 1.1 Characteristics Interface-oriented programming emphasizes interaction between modules through interfaces. First, the caller specifies a set of method signatures; then, the callee implements that set of methods. What sets interface programming apart from other programming styles is that it focuses on methods, not attributes. In many programming scenarios, methods are defined around attributes.

Let's Learn Go -- (5) Goroutine and Channel
· ☕ 7 min read
1. The Concurrency Model in Go 1.1 The Communication Model: CSP CSP stands for Communicating Sequential Process, a model for concurrent communication. A Process can use many Channels, and a Channel does not care who is using it — it is only responsible for sending and receiving data. In the Go community there is a very famous maxim: do not communicate by sharing memory; instead, share memory by communicating.

Let's Learn Go -- (3) Go Modules
· ☕ 2 min read
1. Go’s Package Management Mechanisms 1.1 GOPATH GOPATH pulls code with the go get command and places it in the GOPATH directory. The problems with GOPATH are: It cannot manage package versions It uses a global repository, so it cannot isolate projects effectively 1.2 Vendor Starting with version 1.5, Go

Let's Learn Go -- (2) Data and Logic Structures
· ☕ 3 min read
1. Go’s Data Structures Basic types Boolean: bool Integer: byte, int, int8, int16, uint, uintptr Floating point: float32, float64 Complex: complex64, complex128 String: string Character: rune Error: error Composite types Pointer: pointer Array: array Slice: slice Dictionary: map Channel: chan Struct: struct Interface: interface A Go variable identifier is made up of letters, digits, and underscores, and its first character cannot be a digit.