<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Go語言愛好者周刊:第 108 期 — 一道 sync.WaitGroup 題目

          共 3973字,需瀏覽 8分鐘

           ·

          2021-08-20 04:28

          這里記錄每周值得分享的 Go 語言相關(guān)內(nèi)容,周日發(fā)布。

          本周刊開源(GitHub:polaris1119/golangweekly[1]),歡迎投稿,推薦或自薦文章/軟件/資源等,請(qǐng)提交 issue[2]

          鑒于一些人可能沒法堅(jiān)持把英文文章看完,因此,周刊中會(huì)盡可能推薦優(yōu)質(zhì)的中文文章。優(yōu)秀的英文文章,我們的 GCTT 組織會(huì)進(jìn)行翻譯。

          由于微信公眾號(hào)不支持外鏈,文中大量鏈接可通過文末「閱讀原文」查看。

          題圖:GoLand

          刊首語

          上期是一道關(guān)于 json 的題目,以下代碼輸出什么?

          package main

          import (
           "encoding/json"
           "fmt"
          )

          func main() {
           var p *int
           b, err := json.Marshal(p)
           if err != nil {
            fmt.Println(err)
            return
           }
           fmt.Println(string(b))
          }

          A:panic;B:編譯錯(cuò)誤;C:json marshal 報(bào)錯(cuò);D:null

          正確答案是 D。在 encoding/json 文檔有如下說明:

          bool, for JSON booleans
          float64, for JSON numbers
          string, for JSON strings
          []interface{}, for JSON arrays
          map[string]interface{}, for JSON objects
          nil for JSON null

          本期的題目。以下代碼是否能正確運(yùn)行?

          package main

          import (
           "fmt"
           "sync"
          )

          func main() {
           wg := sync.WaitGroup{}
           wg.Add(1)
           go hello(wg)
           wg.Wait()
          }

          func hello(wg sync.WaitGroup) {
           fmt.Println("hello")
           wg.Done()
          }

          資訊

          1、bleve 2.1.0 發(fā)布[3]

          文本索引庫。

          2、sqlc 1.9.0 發(fā)布[4]

          從 SQL 生成類型安全 Go 代碼。

          3、maddy 0.5.0[5]

          SMTP email 服務(wù)器。

          4、grpc-go 1.40.0[6]

          gRPC Go 的實(shí)現(xiàn)。

          5、go-github 38.1.0[7]

          GitHub API v3 的客戶端,Google 出品。

          6、MongoDB Go Driver 1.7.1[8]

          MongoDB 的 Go 驅(qū)動(dòng),官方出品。

          7、Go+ v1.0.0-beta1 發(fā)布[9]

          所有語法都已經(jīng)實(shí)現(xiàn)。

          8、GoLand 2021.3 路線圖發(fā)布:為支持 Go1.18 做準(zhǔn)備

          2021.3 的路線圖又出來了,一起看看會(huì)有哪些特性。

          9、Excelize 2.4.1 發(fā)布[10]

          2021 年 8 月 2 日,社區(qū)正式發(fā)布了 2.4.1 版本,該版本包含了多項(xiàng)新增功能、錯(cuò)誤修復(fù)和兼容性提升優(yōu)化。

          文章

          1、線上優(yōu)化實(shí)戰(zhàn):大內(nèi)存 Go 服務(wù)性能優(yōu)化

          本文是在上家的 case, 以前很多人在公開大會(huì)上拿該案例做分享,所以覺得有印象的同學(xué)勿噴,雖然冷飯,但是原創(chuàng),而且干貨十足。

          2、Go Modules 教程 第 1 部分:為什么和做什么

          群里時(shí)不時(shí)有人問的問題還跟 GOPATH 有關(guān),還在使用 GOPATH 的方式,于是把這一系列翻譯發(fā)布出來,希望能夠幫助到新手;老手也可以溫習(xí)下。

          3、CGO:關(guān)于回調(diào)函數(shù)和指針的傳遞

          本文并不是一個(gè) Cgo 的使用教程-在閱讀前,需要你對(duì)它對(duì)簡單使用案例有所熟悉。在本文最后列了一些有用的 Cgo 使用教程和相關(guān)的文章。

          4、Go 第三方庫推薦:類型轉(zhuǎn)換如此簡單

          你大概率會(huì)用到。

          5、Go 編譯器的四個(gè)階段

          一篇關(guān)于 Go 編譯器的四個(gè)階段的文章,大家可以學(xué)習(xí)一下,正好為后續(xù)一篇文章做一下鋪墊。

          6、一文告訴你如何幫助測(cè)試Go語言Beta公測(cè)版與RC候選發(fā)布版[11]

          這是一篇關(guān)于如何測(cè)試(Beta 和 RC),測(cè)試什么,以及為什么測(cè)試的文章。

          7、全面講解 Go 中的 interface{}

          空接口可用于保存任何數(shù)據(jù),它可以是一個(gè)有用的參數(shù),因?yàn)樗梢允褂萌魏晤愋汀?/p>

          開源項(xiàng)目

          1、Virgo[12]

          一種基于圖形的配置語言。

          2、staticbackend[13]

          一個(gè)輕量級(jí)的 Firebase 替代品,你可以自行托管。沒有供應(yīng)商的鎖定,你的數(shù)據(jù)保持在你的控制之中。

          3、goelftools[14]

          純 Go 編寫的 ELF 文件解析庫。

          資源&&工具

          1、dasel[15]

          從命令行查詢和更新數(shù)據(jù)結(jié)構(gòu),支持 JSON, TOML, YAML, XML 和 CSV 等格式??梢宰鳛槊钚谢?Go 包使用。

          2、optimus[16]

          輕松、可靠、快速的工作流協(xié)調(diào)器,用于數(shù)據(jù)轉(zhuǎn)換、數(shù)據(jù)建模等。

          3、xsync[17]

          Go 并發(fā)數(shù)據(jù)結(jié)構(gòu)。

          4、播客第 192 期[18]

          Go 與數(shù)據(jù)流處理。

          5、ssaviewer[19]

          GOSSAFUNC 顯示的是用 internal ssa,和平常分析代碼用的 xtools ssa 不是一個(gè)東西,故做了個(gè)簡單的工具。

          訂閱

          這個(gè)周刊每周日發(fā)布,同步更新在Go語言中文網(wǎng)[20]微信公眾號(hào)[21]。

          微信搜索"Go語言中文網(wǎng)"或者掃描二維碼,即可訂閱。

          wechat

          往期推薦參考資料

          [1]

          polaris1119/golangweekly: https://github.com/polaris1119/golangweekly

          [2]

          提交 issue: https://github.com/polaris1119/golangweekly/issues

          [3]

          bleve 2.1.0 發(fā)布: https://github.com/blevesearch/bleve/releases/tag/v2.1.0

          [4]

          sqlc 1.9.0 發(fā)布: https://github.com/kyleconroy/sqlc/releases/tag/v1.9.0

          [5]

          maddy 0.5.0: https://github.com/foxcpp/maddy/releases/tag/v0.5.0

          [6]

          grpc-go 1.40.0: https://github.com/grpc/grpc-go/releases/tag/v1.40.0

          [7]

          go-github 38.1.0: https://github.com/google/go-github

          [8]

          MongoDB Go Driver 1.7.1: https://github.com/mongodb/mongo-go-driver/releases/tag/v1.7.1

          [9]

          Go+ v1.0.0-beta1 發(fā)布: https://github.com/goplus/gop

          [10]

          Excelize 2.4.1 發(fā)布: https://xuri.me/excelize/zh-hans/releases/v2.4.1.html

          [11]

          一文告訴你如何幫助測(cè)試Go語言Beta公測(cè)版與RC候選發(fā)布版: https://tonybai.com/2021/08/11/how-to-test-go-beta-or-rc

          [12]

          Virgo: https://matt-rickard.com/virgo-lang/

          [13]

          staticbackend: https://github.com/staticbackendhq/core

          [14]

          goelftools: https://github.com/hnts/goelftools

          [15]

          dasel: https://github.com/TomWright/dasel

          [16]

          optimus: https://github.com/odpf/optimus

          [17]

          xsync: https://github.com/puzpuzpuz/xsync

          [18]

          播客第 192 期: https://changelog.com/gotime/192

          [19]

          ssaviewer: https://github.com/kkHAIKE/ssaviewer

          [20]

          Go語言中文網(wǎng): https://studygolang.com/go/weekly

          [21]

          微信公眾號(hào): https://weixin.sogou.com/weixin?query=Go%E8%AF%AD%E8%A8%80%E4%B8%AD%E6%96%87%E7%BD%91


          瀏覽 53
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  亚洲精品色哟哟 | 亚洲在线小视频 | 男男无码一区二区三区 | 欧美色图网址 | 小视频+福利 |