西维蜀黍

【Python】升级Python版本

macOS

$ brew install python3
$ brew link python@3.8
  ...


【Golang】关键字 - defer

defer Keyword

Defer is used to ensure that a function call is performed later in a program’s execution, usually for purposes of cleanup. defer is often used where e.g. ensure and finally would be used in other languages.

The canonical examples are unlocking a mutex or closing a file.

  ...


【Golang】初始化(Initialisation)

Constants

Variables

Variables can be initialized just like constants but the initializer can be a general expression computed at run time.

var (
    home   = os.Getenv("HOME")
    user   = os.Getenv("USER")
    gopath = os.Getenv("GOPATH")
)
  ...


【Golang】类型 - string

type string

string is the set of all strings of 8-bit bytes, conventionally but not necessarily representing UTF-8-encoded text. A string may be empty, but not nil. Values of string type are immutable.

type string string
  ...


【Golang】文档

  ...