Giter VIP home page Giter VIP logo

talkgo / night Goto Github PK

View Code? Open in Web Editor NEW
11.8K 716.0 1.2K 60.68 MB

Weekly Go Online Meetup via Bilibili|Go 夜读|通过 bilibili 在线直播的方式分享 Go 相关的技术话题,每天大家在微信/telegram/Slack 上及时沟通交流编程技术话题。

Home Page: https://talkgo.org

License: MIT License

Go 100.00% Dockerfile 0.01% Makefile 0.01%
golang gopher shenzhen offline go reading discuss online zoom-us share

night's People

Contributors

allcontributors[bot] avatar changkun avatar dependabot[bot] avatar feirie avatar felixseptem avatar haojunyu avatar harbinzhang avatar itcuihao avatar jasonrd avatar jiaduo-lin avatar john-deng avatar kissmonx avatar lizhongxuan avatar macaria avatar maxyzli avatar mickey0524 avatar mlboy avatar mougecm avatar orangle avatar qcrao avatar qiangmzsx avatar seladb avatar xpzouying avatar xudong963 avatar xujiajun avatar yangfan21 avatar yangwenmai avatar yuhao5 avatar zhouxinxin19920802 avatar zsy619 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

night's Issues

Weekly Digest (28 February, 2019 - 7 March, 2019)

Here's the Weekly Digest for developer-learning/night-reading-go:


ISSUES

Last week 2 issues were created.
Of these, 2 issues have been closed and 0 issues are still open.

CLOSED ISSUES

❤️ #167 docs(post): add meeting minutes, by polyrabbit
❤️ #166 docs(post): reading etcd/raft, by yangwenmai


PULL REQUESTS

Last week, 2 pull requests were created, updated or merged.

MERGED PULL REQUEST

Last week, 2 pull requests were merged.
💜 #167 docs(post): add meeting minutes, by polyrabbit
💜 #166 docs(post): reading etcd/raft, by yangwenmai


COMMITS

Last week there were 2 commits.
🛠️ docs(post): add meeting minutes by mchangxin
🛠️ docs(post): reading etcd/raft by yangwenmai


CONTRIBUTORS

Last week there were 2 contributors.
👤 mchangxin
👤 yangwenmai


STARGAZERS

Last week there were 24 stagazers.
zhenzou
Jiadz
nange
sendya
Cloud33
kuafou
19951206chao
wq1019
SayHe110
xieguangtai
zhengzhanw
liudonglin
biekanwonicheng
yeezyi
kangzhanlei
kyushuzhao
15106119704
a15641404
3Golds
motopig
cookedsteak
tsingson
royswale
DaoYoung
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository developer-learning/night-reading-go to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Weekly Digest (24 January, 2019 - 31 January, 2019)

Here's the Weekly Digest for developer-learning/night-reading-go:


ISSUES

Last week 3 issues were created.
Of these, 2 issues have been closed and 1 issues are still open.

OPEN ISSUES

💚 #149 go mod 在 goland编辑器中的问题, by wolfstudy

CLOSED ISSUES

❤️ #147 add jaeger md, by jukylin
❤️ #146 ARTICLES: 增加如何调优, by xpzouying

NOISY ISSUE

🔈 #147 add jaeger md, by jukylin
It received 1 comments.


PULL REQUESTS

Last week, 2 pull requests were created, updated or merged.

MERGED PULL REQUEST

Last week, 2 pull requests were merged.
💜 #147 add jaeger md, by jukylin
💜 #146 ARTICLES: 增加如何调优, by xpzouying


COMMITS

Last week there were 3 commits.
🛠️ chore(weekly): change weekly digest on thurday by yangwenmai
🛠️ add jaeger md by jukylin
🛠️ ARTICLES: 增加如何调优 https://github.com/xpzouying/learning_golang/tree/master/how_to_tuning by xpzouying


CONTRIBUTORS

Last week there were 3 contributors.
👤 yangwenmai
👤 jukylin
👤 xpzouying


STARGAZERS

Last week there were 18 stagazers.
xtcmoons
yongliu1992
dengcongbao
coolemiao
wilcosheh
Greentor
ycwei5
hsowan
op-y
redwarn
belonHan
qiuyeming
veetine
wvuu
tdkr
chenjipdc
theonexu
jinliangshui
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository developer-learning/night-reading-go to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Golang 代码质量持续检测

Golang 代码质量持续检测

Author: Kenny Allen

Email: [email protected]

前言

在软件开发过程中,人工检查项目代码中的漏洞和潜在的 BUG 是一件让人十分费神费力的事情,为了解决这一痛点,SonarQube诞生了,它实现了一系列代码自动检测过程,包括命名规范,代码漏洞,代码重复量等。

但是光有 SonarQube 还不能发挥出应有的高效率,一个完整的代码质量持续检测应配合代码仓库(如 gitlab) 和 Jenkins 来共同构建一个自动化过程。

环境

  • Gitlab、Jenkins、SonarQube 服务都在一台物理机上的Docker中运行

  • 网络 (局域网IP:192.168.1.100)

image

  • 主机科学上网代理

    192.168.1.100:1087

    10.03.05

  • 模拟外网访问

    # 修改 hosts 文件,模拟外网访问
    sudo sh -c "echo '192.168.1.100 jenkins.kenny.com\n192.168.1.100 gitlab.kenny.com\n192.168.1.100 sonarqube.kenny.com' >> /etc/hosts"

    10.04.09

  • 工具集

名称 版本
golang go1.10.3
docker 18.03.1-ce

搭建

接下来,我以一个完整的案例来介绍搭建过程。

Jenkins

启动服务
# $jenkins_home 宿主机目录,挂载容器 /var/jenkins_home
# 我的数据卷目录是 ~/.jenkins
export JENKINS_HOME=~/.jenkins
docker run -d --restart=always -p 8080:8080 -p 50000:50000 -v $JENKINS_HOME:/var/jenkins_home --name jenkins jenkins:2.60.3

# 查看 jenkins 日志
docker logs -f jenkins
初始化
  1. 打开浏览器,访问 http://jenkins.kenny.com:8080

    9.11.34

    # 在日志中找到管理员密码
    docker logs -f jenkins 
    
    # 或者在 $JENKINS_HOME/secrets/initialAdminPassword 文件中找到管理员密码
    cat $JENKINS_HOME/secrets/initialAdminPassword

    9.09.27

    9.11.06

  2. 安装推荐插件 (如果你想自定义安装插件,点击 Select plugins to Install)

    9.13.59

  3. 创建管理员账号

    9.19.17

  4. 初始化完成

    9.19.55

Gitlab

启动服务 (gitlab 集成的服务比较多,因此需要占用较大的内存,官方推荐4GB以上)
# $gitlab_home 宿主机目录
# 我的数据卷目录是 ~/.gitlab
export GITLAB_HOME=~/.gitlab
docker run -d --restart=always -e 'GITLAB_HOST=gitlab.kenny.com' -p 443:443 -p 80:80 -p 22:22 -v $GITLAB_HOME/conf:/etc/gitlab -v $GITLAB_HOME:/var/opt/gitlab -v $GITLAB_HOME/log:/var/log/gitlab --name gitlab gitlab/gitlab-ce:11.1.0-ce.0

# 查看 gitlab 日志
docker logs -f gitlab
初始化
  1. 打开浏览器,访问 http://gitlab.kenny.com

    9.26.59

  2. 设置新密码后,使用 root 用户登录

    9.27.29

    9.27.42

  3. 新建 sonarqube 项目组

    9.29.45

  4. 在 sonarqube 项目组下新建 demo 项目

    9.31.26
    9.32.38

  5. 添加主机公钥到 Gitlab

    # 生成 rsa 公钥和密钥
    ssh-keygen -t rsa
    
    # 查看并复制公钥
    cat ~/.ssh/id_rsa.pub

    9.36.12

    9.37.39

    访问 http://gitlab.kenny.com/profile/keys ,将公钥添加至 Gitlab

    9.38.15

    9.38.18

  6. 将 sonarqube/demo 项目拉至主机的 $GOPATH 下

    # 在 $GOPATH 下创建 gitlab.kenny.com 文件夹
    mkdir -p $GOPATH/src/gitlab.kenny.com && cd $GOPATH/src/gitlab.kenny.com
    
    # clone code
    git clone [email protected]:sonarqube/demo.git

SonarQube

启动服务
# 由于目前 sonarqube 官方的 Docker images 只有 7.1 版本,不满足 SonarGO 所需 7.2+ 版本,所以我参考7.1 的 Dockerfile 制作了一个 sonarqube 7.2.1 的镜像
# $sonarqube_home 宿主机目录
# 我的数据卷目录是 ~/.sonarqube
export SONARQUBE_HOME=~/.sonarqube
# 正式环境中应启用外部数据库服务来存储必要数据,在启动容器时设置如下JDBC相关参数:
# -e SONARQUBE_JDBC_USERNAME=sonar 
# -e SONARQUBE_JDBC_PASSWORD=sonar 
# -e SONARQUBE_JDBC_URL=jdbc:postgresql://localhost/sonar
docker run -d --restart=always -p 9000:9000 -v $SONARQUBE_HOME:/opt/sonarqube/data --name sonarqube kennyallen/sonarqube:7.2.1

# 查看 sonarqube 日志

Dockerfile:

FROM openjdk:8

ENV SONAR_VERSION=7.2.1 \
    SONARQUBE_HOME=/opt/sonarqube \
    SONARQUBE_JDBC_USERNAME=sonar \
    SONARQUBE_JDBC_PASSWORD=sonar \
    SONARQUBE_JDBC_URL=


# Http port
EXPOSE 9000

RUN groupadd -r sonarqube && useradd -r -g sonarqube sonarqube

# grab gosu for easy step-down from root
RUN set -x \
    && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/1.10/gosu-$(dpkg --print-architecture)" \
    && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/1.10/gosu-$(dpkg --print-architecture).asc" \
    && export GNUPGHOME="$(mktemp -d)" \
    && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
    && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
    && rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc \
    && chmod +x /usr/local/bin/gosu \
    && gosu nobody true

RUN set -x \
    && cd /opt \
    && wget -O sonarqube.zip https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-$SONAR_VERSION.zip \
    && unzip sonarqube.zip \
    && mv sonarqube-$SONAR_VERSION sonarqube \
    && chown -R sonarqube:sonarqube sonarqube \
    && rm sonarqube.zip \
    && rm -rf $SONARQUBE_HOME/bin/*

VOLUME "$SONARQUBE_HOME/data"

WORKDIR $SONARQUBE_HOME
COPY run.sh $SONARQUBE_HOME/bin/
ENTRYPOINT ["./bin/run.sh"]

run.sh:

#!/bin/bash

set -e

if [ "${1:0:1}" != '-' ]; then
  exec "$@"
fi

chown -R sonarqube:sonarqube $SONARQUBE_HOME
exec gosu sonarqube \
  java -jar $SONARQUBE_HOME/lib/sonar-application-$SONAR_VERSION.jar \
  -Dsonar.log.console=true \
  -Dsonar.jdbc.username="$SONARQUBE_JDBC_USERNAME" \
  -Dsonar.jdbc.password="$SONARQUBE_JDBC_PASSWORD" \
  -Dsonar.jdbc.url="$SONARQUBE_JDBC_URL" \
  -Dsonar.web.javaAdditionalOpts="$SONARQUBE_WEB_JVM_OPTS -Djava.security.egd=file:/dev/./urandom" \
  "$@"
初始化
  1. 打开浏览器,访问 http://sonarqube.kenny.com:9000

    8.58.40

  2. 使用管理员账号登录

    • 账号 admin
    • 密码 admin

    8.59.06

  3. 生成 token (作为远程连接 SonarQube 的标识,只生成一次,记得备份哦)

    admin_token: 74439d5bc557dcc206fa8b1f2f5516e65680bdc8

    8.59.41

  4. 安装插件 (进入 Administration -> Marketplace)

    9.01.25

    安装完成后点击重启 SonarQube 服务就OK了

集成

  • 将 Jenkins、Gitlab 和 SonarQube 有机整合

Jenkins 安装插件

  1. 点击进入 系统管理 -> 插件管理 -> 可选插件

    9.43.39

  2. 过滤选中 Gitlab、SonarQube Scanner,点击下载待重启后安装

    9.45.12
    9.45.35

    10.19.06

Jenkins 配置

  1. 安装 SonarQube & JDK

    进入 系统管理 -> Global Tool Configuration

    JDK 安装

    ​ 勾选我同意 Java SE Development Kit 的许可协议

    ​ 点击 Please enter your username/password

    11.31.38

    输入你的 oracle 账号密码

    10.20.43

    SonarQube Scanner 安装11.32.15

  2. SonarQube Server

    进入 系统管理 -> 系统设置

    Add SonarQube servers

    Name 随便填写

    Server URL: http://sonarqube.kenny.com:9000

    Server version: 5.3 or higher

    Server authentication token: 填 SonarQube 初始化时生成的 token

    9.53.05

  3. 取消 Gitlab 授权

    取消选中 Enable authentication for '/project' end-point,保存

    11.20.17

  4. 在 jenkins 容器中安装 golang 环境及工具

    # 在 Jenkins 容器中执行命令
    docker exec -it jenkins /bin/bash
    # 临时设置环境变量
    export GOROOT=$JENKINS_HOME/go
    export GOPATH=$JENKINS_HOME/workspace/go
    export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
    export http_proxy=http://192.168.1.100:1087;export https_proxy=http://192.168.1.100:1087;
    # 进入 jenkins 主目录
    cd $JENKINS_HOME
    # 下载 golang
    wget https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz
    # 解压 golang 包
    tar -xvf  go1.10.3.linux-amd64.tar.gz
    # 删除 golang 包
    rm go1.10.3.linux-amd64.tar.gz
    # 安装必要工具
    # vgo
    go get -u -v golang.org/x/vgo
    # gometalinter
    go get -u -v github.com/alecthomas/gometalinter
    gometalinter --install
  5. 配置邮件通知

    进入 系统管理 -> 系统设置

    Jenkins Location

    系统管理员邮件地址修改为你自己的邮箱地址,如 [email protected]

    11.29.11

    Extend E-mail Notification

    SMTP Server 填写对应的SMTP服务地址,如 smtp.163.com

    点击高级,勾选使用SMTP认证

    用户名 注意不需要加 @xxx.xxx

    密码 填写自己的邮箱密码或授权码

    10.26.50

    11.50.08

    Default Triggers 选中 Always

    11.50.26

新建 Jenkins 构建任务

  1. 新构建一个自由风格的软件项目

    10.35.38

  2. 使用自定义的工作空间

    点击高级,勾选使用自定义的工作空间

    10.28.20

    目录:$JENKINS_HOME/workspace/go/src/gitlab.kenny.com/demo

    10.51.25

  3. 源码管理

    Repository URL:http://gitlab.kenny.com/sonarqube/demo

    Credentials:点击Add ,添加凭据 (Gitlab 用户名密码或 SSH登录等方式都可以)10.37.19

    10.29.32

  4. 构建触发器,选中

    Build when a change is pushed to GitLab. GitLab webhook URL: http://jenkins.kenny.com:8080/project/demo

    Enabled GitLab triggers 选中 Push Events 和 Accepted Merge Request Events ,表示当 Gitlab 有 push 或 merge 操作发生时触发构建。

    10.39.03

  5. 新建 webhook

    在浏览器中打开 http://gitlab.kenny.com/admin/application_settings (请使用 root 登录),找到 Outbound requests ,点击 Expand 后,选中 Allow requests to the local network from hooks and services 并保存更改。 (允许本地网络的 githook)

    10.43.37

    进入 http://gitlab.kenny.com/sonarqube/demo/settings/integrations

    URL: http://jenkins.kenny.com:8080/project/demo

    SecretToken: 不填

    选中 Push eventsMerge request events

    取消选中 Enable SSL verification

    点击 Add web hook

    10.46.50

  6. 增加构建步骤,选中 Execute Shell

    #!/bin/bash
    # 环境变量
    export GOROOT=$JENKINS_HOME/go
    export GOPATH=$JENKINS_HOME/workspace/go
    export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
    export http_proxy=http://192.168.1.100:1087;export https_proxy=http://192.168.1.100:1087;
    
    # 安装依赖
    vgo mod -vendor
    
    # coverage
    go test ./... -coverprofile=coverage.out
    
    # test
    go test ./... -json > report.json
    
    # vet
    go vet ./... 2> govet-report.out
    
    # golint
    golint ./... > golint-report.out
    
    # gometalinter 
    # 执行 gometalinter 会失败,因此加了 || true
    gometalinter ./... > gometalinter-report.out || true
  7. 增加构建步骤,选中 Execute SonarQube Scanner

    Analysis properties

    sonar.projectKey=gitlab.kenny.com
    sonar.projectName=demo
    sonar.sources=.
    sonar.exclusions=**/*_test.go,**/vendor/**
    sonar.tests=.
    sonar.test.inclusions=**/*_test.go
    sonar.test.exclusions=**/vendor/**
    sonar.go.coverage.reportPaths=coverage.out
    sonar.go.tests.reportPaths=report.json
    sonar.go.govet.reportPaths=govet-report.out
    sonar.go.golint.reportPaths=golint-report.out
    sonar.go.gometalinter.reportPaths=gometalinter-report.out
  8. 增加构建后操作,选中 Editable Email Notification

    Project Recipient List 填写接收邮件的Email地址,或使用默认配置

    Default Content 加上 SonarQube URL: http://sonarqube.kenny.com:9000

    11.51.18

测试

# clone demo 代码
cd $GOPATH/src/gitlab.kenny.com && git clone [email protected]:yuhao5/sonarqube-golang.git && rm -rf demo && mv sonarqube-golang demo && cd demo
# push 代码,触发 Jenkins 任务进行自动构建
git remote add gitlab [email protected]:sonarqube/demo.git
git push -u gitlab master

# 若 gitlab 仓库地址不是 [email protected]:sonarqube/demo.git ,请根据以下步骤修改:
docker exec -it gitlab /bin/bash
vim /etc/gitlab/gitlab.rb
# 找到 external_url,修改为 external_url 'http://gitlab.kenny.com'
# 然后执行
gitlab-ctl reconfigure

11.53.59

11.35.27

11.09.34

11.10.01

11.10.42

TODO

  1. 解决执行 gometalinter 失败问题
  2. Golang 质量标准,规则自定义

Weekly Digest (7 February, 2019 - 14 February, 2019)

Here's the Weekly Digest for developer-learning/night-reading-go:


ISSUES

Last week 1 issue was created.
It is closed now.

CLOSED ISSUES

❤️ #152 docs(post): update file name, by yangwenmai


PULL REQUESTS

Last week, 1 pull request was created, updated or merged.

MERGED PULL REQUEST

Last week, 1 pull request was merged.
💜 #152 docs(post): update file name, by yangwenmai


COMMITS

Last week there was 1 commit.
🛠️ docs(post): update file name by yangwenmai


CONTRIBUTORS

Last week there was 1 contributor.
👤 yangwenmai


STARGAZERS

Last week there were 9 stagazers.
marionxue
NSNEVER
gitsrc
rovast
Waitfantasy
zixks
gmyofustc
tommyliu1114
xartisan
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository developer-learning/night-reading-go to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

第 34 期 plan9 汇编入门,带你打通应用和底层

这是今天春晖大佬要讲的内容,我从滴滴内网上找到的资料,晚上一定要勾搭上曹大。

推荐大家阅读,建议大家以后夜读之前一定要提前预习,并且提议参与夜读的同学每人至少准备一个问题,可以随时提问。好处:提高参会者参与感,提前预习,带着问题也会更有效率;提高主讲人的存在感,上次我分享的时候,感觉全程就我一人存在,没有反馈,体验不太好。

附件是春晖大佬的文章:

《plan9 汇编入门,带你打通应用和底层》视频回放
曹春晖——plan9 assembly 完全解析.pdf
《plan9 汇编入门,带你打通应用和底层》讲义
《plan9 汇编入门,带你打通应用和底层》视频地址
曹大的Go高级编程书,纸质书即将出版
曹大go源码阅读
曹大博客

Weekly Digest (31 January, 2019 - 7 February, 2019)

Here's the Weekly Digest for developer-learning/night-reading-go:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were 11 stagazers.
demonkm
jiangdless
uxgnaw
420691301
wokill
scapegoat1630
wsbjwjt
pangzicaicai
holen1210
albert-8
tian2008
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository developer-learning/night-reading-go to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

【sync.Once源码分析】注释问题!

sync.Once源码分析中Do方法的注释有一部分有问题:

func (o *Once) Do(f func()) {
        //......
	if o.done == 0 {
	        // 原注释:先将done设置为1,再执行f函数
                defer atomic.StoreUint32(&o.done, 1)
		f()
	}
}
  1. done不会先设置为1,而是在退出Do函数时设置为1
  2. defer在此处还有另一个用意——即便f()发生panic仍会在退出Do函数时将0.done设置为1
    • 由此引发的另一个问题是调用者需要确认:你的f()正确执行,你保存的once对象也是与f()正确执行时对应的那个once对象
    • 一旦f()发生错误要重新创建once对象再调用once.Do(f)(绝不可复用前一个once对象)
    • 若f()成功则保留该once对象,不成功重复上面的过程

Weekly Digest (21 February, 2019 - 28 February, 2019)

Here's the Weekly Digest for developer-learning/night-reading-go:


ISSUES

Last week 6 issues were created.
Of these, 5 issues have been closed and 1 issues are still open.

OPEN ISSUES

💚 #162 第 32 期 Go 夜读之 etcd raft 源码阅读预习材料, by yangwenmai

CLOSED ISSUES

❤️ #164 docs(post): reading flag, by yangwenmai
❤️ #163 docs(post): update preview raft, by yangwenmai
❤️ #161 docs(post): update preview raft, by yangwenmai
❤️ #159 Notice, by yangwenmai
❤️ #158 docs(post): update go mod part 4 and notice, by yangwenmai


PULL REQUESTS

Last week, 5 pull requests were created, updated or merged.

MERGED PULL REQUEST

Last week, 5 pull requests were merged.
💜 #164 docs(post): reading flag, by yangwenmai
💜 #163 docs(post): update preview raft, by yangwenmai
💜 #161 docs(post): update preview raft, by yangwenmai
💜 #159 Notice, by yangwenmai
💜 #158 docs(post): update go mod part 4 and notice, by yangwenmai


COMMITS

Last week there were 5 commits.
🛠️ docs(post): reading flag by yangwenmai
🛠️ docs(post): update preview raft by yangwenmai
🛠️ docs(post): update preview raft by yangwenmai
🛠️ docs(post): update words by yangwenmai
🛠️ docs(post): update go mod part 4 and notice by yangwenmai


CONTRIBUTORS

Last week there was 1 contributor.
👤 yangwenmai


STARGAZERS

Last week there were 16 stagazers.
simplephp
shaoqi
qcrao
fei922
lppklm
wuchuwuyou
YihuaWanglv
zhengzhong1210
ray1888
haroldduan
buffge
krucezhang
hakehong
zoroqi
WaterRice
sweetweapen
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository developer-learning/night-reading-go to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Weekly Digest (14 February, 2019 - 21 February, 2019)

Here's the Weekly Digest for developer-learning/night-reading-go:


ISSUES

Last week 4 issues were created.
Of these, 3 issues have been closed and 1 issues are still open.

OPEN ISSUES

💚 #155 Weekly Digest (12 February, 2019 years - 19 February, 2019 years), by yangwenmai

CLOSED ISSUES

❤️ #157 Update 2018-11-08-http-router-in-go.md , by xujiajun
❤️ #156 feat(bigdecimal): add discuss, by yangwenmai
❤️ #154 docs(post): update go mod part 4, by yangwenmai


PULL REQUESTS

Last week, 3 pull requests were created, updated or merged.

MERGED PULL REQUEST

Last week, 3 pull requests were merged.
💜 #157 Update 2018-11-08-http-router-in-go.md , by xujiajun
💜 #156 feat(bigdecimal): add discuss, by yangwenmai
💜 #154 docs(post): update go mod part 4, by yangwenmai


COMMITS

Last week there were 3 commits.
🛠️ feat(bigdecimal): add discuss by yangwenmai
🛠️ Update 2018-11-08-http-router-in-go.md by xujiajun
🛠️ docs(post): update go mod part 4 by yangwenmai


CONTRIBUTORS

Last week there were 2 contributors.
👤 yangwenmai
👤 xujiajun


STARGAZERS

Last week there were 17 stagazers.
JarHMJ
wen-long
hioop
3lackrush
wangzhiyuanme
Joursion
Amanda111
crazycarry
Nexpro
kenvinwei
wenwen936
uhowep
wheatj
chunzhouyu
JiangTengfei
si9ma
sunhongyue4500
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository developer-learning/night-reading-go to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

go mod 在 goland编辑器中的问题

当我们clone一个.mod的go项目的时候,一般我们只要使用go mod tidy就可以找到我们所需要的相关依赖包,但是在goland中,我们需要注意,具体如下图:

image.png

如图所示:我们需要在goland中将mod打开,否则goland会找不到对应的module文件。

之后重启 goland 即可

致谢:杨文

Telegram Bot 功能建议

  1. 新人报道,自动发送欢迎消息,附上项目相关的 Github,Youtube 链接。以及加群注意事项
  2. Github 有更新自动发送提交记录到群里
  3. Youtube 有更新,也自动发送链接
  4. 还可以抓一些比较好的博客文章发到群里
  5. 抓去 Go 官方博客
  6. 抓去 Github Go 的 Release 记录
  7. 根据时间屏蔽群里的发图频率
  8. 广告机器人屏蔽

Weekly Digest (3 January, 2019 - 10 January, 2019)

Here's the Weekly Digest for developer-learning/night-reading-go:


ISSUES

Last week 1 issue was created.
It is closed now.

CLOSED ISSUES

❤️ #120 docs(post): update github+netlify, by yangwenmai


PULL REQUESTS

Last week, 1 pull request was created, updated or merged.

MERGED PULL REQUEST

Last week, 1 pull request was merged.
💜 #120 docs(post): update github+netlify, by yangwenmai


COMMITS

Last week there was 1 commit.
🛠️ docs(post): update github+netlify by yangwenmai


CONTRIBUTORS

Last week there was 1 contributor.
👤 yangwenmai


STARGAZERS

Last week there were 23 stagazers.
chx0501
aKaigege
loveFeng
Hyvi
LiuYamn
guoweikuang
ChengYayu
LIYINGZHEN
Alex1996a
WisperDin
Allianzcortex
Mr9esx
liunian1004
supercoding
jichengwang
niyonghui
dsmlily
jlutt
dunhamdaxia
alonlong
t-zeus
SJTUboy
ritayzy
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository developer-learning/night-reading-go to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Weekly Digest (20 January, 2019 - 27 January, 2019)

Here's the Weekly Digest for developer-learning/night-reading-go:


ISSUES

Last week 7 issues were created.
Of these, 6 issues have been closed and 1 issues are still open.

OPEN ISSUES

💚 #147 add jaeger md, by jukylin

CLOSED ISSUES

❤️ #146 ARTICLES: 增加如何调优, by xpzouying
❤️ #145 docs(post): update reading, by yangwenmai
❤️ #144 docs(post): update reading opentracing jaeger, by yangwenmai
❤️ #143 chore(README): update replay, by yangwenmai
❤️ #142 docs(post): update reading date, by yangwenmai
❤️ #141 added k8s reading, by john-deng

NOISY ISSUE

🔈 #141 added k8s reading, by john-deng
It received 1 comments.


PULL REQUESTS

Last week, 7 pull requests were created, updated or merged.

UPDATED PULL REQUEST

Last week, 1 pull request was updated.
💛 #147 add jaeger md, by jukylin

MERGED PULL REQUEST

Last week, 6 pull requests were merged.
💜 #146 ARTICLES: 增加如何调优, by xpzouying
💜 #145 docs(post): update reading, by yangwenmai
💜 #144 docs(post): update reading opentracing jaeger, by yangwenmai
💜 #143 chore(README): update replay, by yangwenmai
💜 #142 docs(post): update reading date, by yangwenmai
💜 #141 added k8s reading, by john-deng


COMMITS

Last week there were 7 commits.
🛠️ ARTICLES: 增加如何调优 https://github.com/xpzouying/learning_golang/tree/master/how_to_tuning by xpzouying
🛠️ docs(post): update reading by yangwenmai
🛠️ docs(post): update reading opentracing jaeger by yangwenmai
🛠️ chore(README): update replay by yangwenmai
🛠️ docs(post): update reading date by yangwenmai
🛠️ adjust weight by john-deng
🛠️ added k8s reading by john-deng


CONTRIBUTORS

Last week there were 3 contributors.
👤 xpzouying
👤 yangwenmai
👤 john-deng


STARGAZERS

Last week there were 17 stagazers.
pureboys
witness02
ClareChu
zh1014
chengjingtao
l5211314121
xtcmoons
yongliu1992
dengcongbao
coolemiao
wilcosheh
Greentor
ycwei5
hsowan
op-y
redwarn
belonHan
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository developer-learning/night-reading-go to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

获取昨天时间,获取n天前的时间。____大风

获取昨天时间:
timeCST := time.Now()
yesTime := timeCST.AddDate(0, 0, -1) // 能得到昨天时间
若在循环中,例如for i:=0, i<5,i++
yesTime := timeCST.AddDate(0, 0, -i+1)
的循环中,为什么从后天开始往前计算。而不是直接往前推5天。

自动更新 README 脚本化

现在更新某子项目的时候会存在同时要同步两个 README.md ,是否可以做到添加文件后自动更新呢?

Weekly Digest (12 February, 2019 years - 19 February, 2019 years)

Here's the Weekly Digest for developer-learning/night-reading-go:


PULL REQUESTS

Last weeks (2019-02-12 08:00:00 +0000 UTC~2019-02-19 08:00:00 +0000 UTC), 2 pull request's were created, updated or merged.

MERGED PULL REQUEST

Last weeks, 2 pull request were/was merged.
💜 #154 docs(post): update go mod part 4 merged at 2019-02-16 14:37:39 +0000 UTC, by yangwenmai
💜 #152 docs(post): update file name merged at 2019-02-13 14:07:19 +0000 UTC, by yangwenmai


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.