zoukankan      html  css  js  c++  java
  • 后端程序员之路 53、A Tour of Go-3

    #method
        - Methods
            - Go does not have classes. However, you can define methods on types.
            - func (f MyFloat) Abs() float64 {
        - Interfaces
            - type Abser interface { Abs() float64 }
            - One of the most ubiquitous interfaces is Stringer defined by the fmt package.
            - Go programs express error state with error values.
            - The io package specifies the io.Reader interface, which represents the read end of a stream of data.
            - Package image defines the Image interface

    # concurrency
        - Goroutines - go say("world")
        - Channels
            - Channels are a typed conduit through which you can send and receive values with the channel operator, <-.
            - ch := make(chan int)
            - ch <- v    // Send v to channel ch.
            - v := <-ch  // Receive from ch, and assign value to v.
            - Buffered Channels - ch := make(chan int, 100)
        - Select
            - The select statement lets a goroutine wait on multiple communication operations.
            - The default case in a select is run if no other case is ready.
            - sync.Mutex
                - mux sync.Mutex
                - c.mux.Lock()
                - defer c.mux.Unlock()

    A Tour of Go
    https://tour.golang.org/list

  • 相关阅读:
    生成前N个自然数随机置换的3个程序
    网络流媒体协议之——RTSP协议
    海思屏幕HAL代码解析
    事件路由
    hi3559v100 sdk中双系统AMP架构的初步了解
    LCD RGB 控制技术 时钟篇(下)【转】
    liteos C++支持(十七)
    liteos MMU(十八)
    APP接口做什么?
    APP如何进行通信的
  • 原文地址:https://www.cnblogs.com/zapline/p/6835882.html
Copyright © 2011-2022 走看看