0%

Docker 在前两年读研时经常会有实验室的师兄提起, 属于一直有所耳闻, 未曾深入了解的范畴. 目前在工作中, 发现Docker 是当前程序员必备技能之一, 公司微服务架构中,云计算的实现中,项目容器化的实践中 均使用Docker 作为实现工具. 所以需要对Docker 有一个基础而全面的认知才行. 这里以上述专栏为契机, 简单认识下Docker.

Read more »

Definition

defer statement is the keyword of go language. defer statement would delay the execution of function, method and anonymous method until the innermost call function return. Attention please, the arguments of defer function evaluate instantly while the execution is delay. Example is shown in the below part.

Read more »

Keywords

keywords are original ideneifiers which help complier to understand and parse user code

  • Declare keywords

    1
    const, func, import, package, type, var
  • Type denotation keywords

    1
    chan, interface, map, struct
  • Control flow keywords

    1
    break, case, continue, default, else, fallthrough, for, goto, if, range, return, select, switch, defer, go

    Idenfiers

Idenfiers ,defined by user, is used to idenfie something. Compose by : Unicode Letter , Unicode Number, Underscore _;

  • Keywords can not be used as idenfiers

  • Idenfier _ is a special idenfier, called blank idenfier

  • Export (Public) identifier is start with upper case unicode Letter

    1
    2
    3
    4
    5
    Player_9
    DoSomething
    VERSION
    Ĝo
    Π
  • UnExport (Private) identifier do not start with upper case unicode letter

    1
    2
    3
    4
    5
    6
    7
    8
    _
    _status
    memStat
    book
    π
    一个类型
    변수
    エラ
  • illegal identifier

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    // Starting with a Unicode digit.
    123
    3apples

    // Containing Unicode characters not
    // satisfying the requirements.
    a.b
    *ptr
    $name
    a@b.c

    // These are keywords.
    type
    range