Watch your concern - Golang Community Research Report

Golang language can be said now hot, is to use the familiar Kubernates Golang development.
We surveyed more than 1,000 developers GopherCon General Assembly recently held in San Diego in London and on to a better understanding of the development community and Go overall view of the Go Module of. With the recent release of version 1.13 Go, now is a good time to share some interesting data to the community.

BTW, in JFrog, we are also Go developer (JFrog CLI and Xray are written in Go). Also GoLang contributor community, and contributed to public registry Gocenter (goproxy) for community maintenance https://gocenter.io/ . Golang accelerated language developers to build speed.

Here are some key things we learned:

Go developers are highly invested
vast majority Go developers are using the latest version of GoLang. More than 70 percent of respondents said they are using the latest version of Go 1.12.
It is also worth noting that more than 82 percent of Golang developers using version 1.11 or later, it is possible to use Go Module. Only a small part of the report uses an earlier version of Go.
Watch your concern - Golang Community Research Report

Almost as many use the latest version of Go developers also reported using the Go Module in their organizations. There are a lot of people want to use Go Module as soon as possible, so that by mid-2020, the utilization rate will rise to at least 80%, and may be close to 100%.
Watch your concern - Golang Community Research Report

GoLang is widely used in various industries
, although Go development for a wide range of computing, but only behind DevOps Web development, nearly one in five reported that they use Go to achieve these aims. Scoring systems, databases and web applications is also high, which indicates that there is still much room for growth in the promising field of mobile and embedded devices.
Watch your concern - Golang Community Research Report

选择Go Module很难
当开发人员选择开源组件时,他们倾向于追求安全性和质量。但在如何判断 Go Module的风险方面,几乎没有共识。
大多数报告显示人们偏好用他人使用最多的包,以及流行度所带来的保证。同时安全漏洞也是一个问题,开发人员如何确定一个包的风险在各种各样的条件下是不同的,如内网环境和外网环境同一个漏洞的处理可能是不一样的。
Watch your concern - Golang Community Research Report

如何更好更快的选择Go Module
由于开发人员在选择越来越多的Go模块时遇到了困难,GoCenter通过交互搜索帮助用户发现。一旦你有了结果,GoCenter会提供你需要的所有信息来决定哪些模块最适合你的需求,包括活动和星级。我们也正在开发一个系统,根据选择的标准来给模块打分,这将更好的帮助Golang开发人员更快的选择到合适的模块。
Watch your concern - Golang Community Research Report

GoCenter
我们感谢所有对我们GoLang调查做出回应的开发者。我们从中获得的信息将帮助我们帮助您,特别是在我们继续使GoCenter成为帮助采用Go Module的有用工具的情况下。

如果您还没有听说过GoCenter,那么它提供了不可变的、版本化的模块的中心源,这些模块直接从公共源存储库中的Go项目进行处理和验证。在众多好处中,使用GoCenter可以加快GoLang应用程序的构建时间。

GoCenter现在托管了超过260,000个版本化的Go Module,这些模块可以免费提供给Go开发者社区。

GoCenter与Golang 1.13的最佳实践

  1. 使用Gocenter 作为Goproxy
    在Golang 1.13中,Go Module的支持在默认情况下是启用的。尽管Go客户端的新安装会自动设置一个默认的google托管代理,在国内你可以覆盖它并使用你选择的Go Module代理,比如GoCenter。

要使用GoCenter作为版本化go模块的代理,请将GOPROXY环境变量设置为GoCenter URL:
Watch your concern - Golang Community Research Report

Golang 1.13中的新特性允许您在GOPROXY中指定由逗号分隔的多个代理,以及直接从源代码下载模块的Direct 模式(这种模式的场景是goproxy中没有对应模块或版本是会返回404)。但是GoCenter目前支持了自动包含特性,意味着您在使用GoCenter进行代理时不需要使用这些Direct模式,当gocenter中目前没有缓存对用组件时,会自动触发到源码库中自动拉取对应组件以及版本。
https://github.com/jfrog/gocenter/blob/master/releases.md#2019-march-27-enhanced-automatic-inclusion-of-go-modules

  1. 校验和(checksum)数据库支持
    从Golang的1.13版开始,go get通过谷歌在sum.golang.org上维护的一个可审计的校验和数据库来执行模块的身份验证。版本1.13会使用GOSUMDB环境变量中默认设置这个校验和的DB URL。
    GoCenter已经通过代理sum.golang.org帮助我们加速构建。如果你的GOPROXY设置为GoCenter,你不需要改变任何东西-你已经通过GoCenter验证你的模块了!

  2. 私有Go Module 仓库
    GoCenter用于代理通过公共源存储库(如Github)共享的Go Module。Golang 1.13还引入了一些环境变量,特别是GOPRIVATE,用于绕过代理和校验和验证,从私有存储库下载模块版本, 此场景比较适合企业内部有大量自研发Go Module。您可以在Golang文档中了解如何使用它们。

  3. Version Verification
    in version 1.13, it is very important to use the correct suffix Go Module. go command now performs additional validation of version string request, if the module does not meet the semantic import version control, go get will fail. Therefore, the pseudo version before Golang 1.13 loaded modules (pseudo version) may fail.

Guess you like

Origin blog.51cto.com/jfrogchina/2460412