您的位置 首页 golang

Golang 1.14新特性介绍

Golang 1.14新特性介绍

最新的Go语言release版本带来了全面的改进,包括对runtime的改善和对WebAssembly的支持。

Go 1.14是 go ogle开发的用于创建 Docker,Kubernetes,Istio和其他云原生计算项目的开源编程语言的最新版本,现已作为release版本提供。

2月25日发布的Go升级改进了运行时和编译器。根据发行说明,1.14版还将是最后一个支持32位Apple平台的版本。

与Go运行时的改进相比,defer大多数用例的性能得到了提高,几乎不产生任何开销。因此,defer现在可以在对性能至关重要的代码中使用,而无需担心开销。

改进的Go运行时也使goroutines异步抢占。这意味着没有 函数调用 的循环不再可能使调度程序 死锁 或明显延迟垃圾回收。此功能支持除了 windows/ arm darwin /arm,js/wasm,和plan9/* 之外的所有平台。

抢占式实现的结果之一是Linux和 MacOS 上的Go 1.14程序将比早期版本接收更多的信号。使用诸如 syscall golang.org/x/sys/ unix 软件包 的程序失败时将看到较慢的系统调用,并显示 EINTR 错误。这些程序将必须以某种方式处理这些错误,最有可能的方法是循环尝试再次调用系统。

此外,页面分配器更有效,并且在的高值时导致较少的锁争用GOMAXPROCS。较低的延迟和较高的吞吐量对于并行且高速率完成的大型分配而言,这将是最显着的。

同时,Go编译器添加了一个 -d=checkptr 编译时选项,用于检查Go代码是否动态遵守 unsafe.Pointer 安全规则。而且,编译器现在可以使用该 -json 标志发出机器可读的关键优化日志,包括内联和消除边界检查。现在,详细的逃逸分析诊断程序将再次起作用,并且为编译器插入的模糊测试提供了实验支持。

Go 1.14中的其他更改和改进

为了改进Go对WebAssembly的支持,js.Value现在可以对通过对象从Go引用的JavaScript值进行垃圾收集。但是,js.Value无法再使用==运算符比较对象。而是必须使用Equal方法比较它们。另外,js.Value现在有IsUndefined,IsNull和IsNaN方法。

与Rust语言类似,Go 1.14版本将是最后一个在MacOS上支持32位二进制文​​件的版本。它还可能是最后一个在其他Apple平台(包括iOS, iPadOS ,WatchOS和tvOS)上支持32位二进制文​​件的软件。

在语言更改中,现在允许嵌入重叠的接口。

不再支持Google Native Client平台

现在支持FreeBSD的64位体系结构。

go命令现在在module模式下支持Subversion仓库。现在,该命令还包含来自模块代理和其他HTTP服务器的纯文本错误消息的摘要。仅当它是有效的UTF-8且仅包含图形字符和空格时,才会显示错误消息。

Windows上的 二进制文件 启用了 数据执行保护 (DEP)以进行系统级内存保护。

一个新的标志, -modfile=file 指示go命令读取并写入一个替代的go.mod文件,而不是module根目录中的文件。

go get命令不再接受该 -mod 标志。

一个新的标志 -modcacherw 指示go命令以默认权限而不是只读的方式将新创建的目录保留在模块高速缓存中。此标志使测试或其他工具更有可能意外添加不在模块 checksum 校验中的文件。但是它允许使用 rm -rf 删除模块缓存。

hash/maphash包在字节序列上提供哈希函数。

GOINSECURE是一个新的环境变量,它指示go命令直接从某些模块的源中获取某些模块时允许HTTPS连接跳过证书验证。

文章来源:智云一二三科技

文章标题:Golang 1.14新特性介绍

文章地址:https://www.zhihuclub.com/97702.shtml

关于作者: 智云科技

热门文章

评论已关闭

28条评论

  1. Because the cable is infinite the resistance to the right of any vertical cut equivalent to line b is also R T

  2. why the study is important Condition or disease Intervention treatment Phase Breast Cancer Drug cyclophosphamide Drug doxorubicin hydrochloride Drug octreotide pamoate Drug tamoxifen citrate Phase 3

  3. Bell IR, Caspi O, Schwartz GE et al B 14d old primary tumors regressed after treatment with 20 Gy

  4. The method of claim 106, wherein the composition is applied to scalp in an area comprising the frontal, central, vertex regions, or a combination thereof of the scalp I d like to hear from someone in the know as well

  5. The causes of a high HOXB13 expression in breast tumors are still not completely clear You do not receive prescription drug coverage under any private insurance or any other coverage that provides assistance to help pay for medicines, such as Employer furnished or private prescription drug coverage VA or Military Benefits Medicaid Medicare Part A Medicare Part B covers some injectable medicines Medicare Part D State assistance program for medicines SPAP, SCHIP, PACE, etc

  6. This hormone is required for maintaining proper health and avoiding cardiovascular diseases as well as diabetes type 2

  7. Do you really take me for a fool, Glancing at the how to revers the affect of diet pills fiery red fur all over his body, Jeff was so guessing, Of using weight loss pills course, the solution is to come again

  8. Reverse transcription RT was performed using the High Capacity cDNA RT kit Applied Biosystems, Life Technologies, Bleiswijk, Netherlands

  9. Silvia, and C During this period, they kept starving us until we were very hungry, and then they gave us a small amount of food, let them snatch, kill each other, and have no feelings at all

  10. Although there has been no sufficient investigation of the efficacy and safety of reducing hydration volume to manage malignancy related ascites, oncologists in Japan seemed to commonly express concern about preventing overhydration in terminally ill cancer patients

  11. Following pronuclear injection into fertilized FVB NJ oocytes and implantation into foster mothers, the transgenic founder was identified by polymerase chain reaction PCR with primers recognizing the Cre sequence 5 AGCGATCGCTGCCAGGAT 3 and 5 ACCAGCGTTTTCGTTCTGCC 3

  12. Aumance was one of around 75 places once known by the name Equoranda, a word with an unknown root that resembles the Greek and Gaulish for sound line or call line

  13. 2 Swallow whole; do not split, crush, dissolve, or chew 2 Novel therapeutic approaches to prevent drug induced torsade de pointes Norman Stockbridge, MD, PhD CDER

  14. Goodman MT, Stevens JL 2010 Breast cancer in men in the US a population based study of diagnosis, treatment and survival

  15. On the other hand, subacute bacterial endocarditis diagnosis is often delayed and presents with non specific symptoms such as weight loss, fatigue, and dyspnea over several weeks to months com 20 E2 AD 90 20Viagra 20Pill 20Icon 20 20Viagra 20Prodaja 20Cena viagra prodaja cena Habibullah Fauzi, a former Taliban diplomat who is now a member of Karzai s High Peace Council, told The Associated Press that some individuals on the peace council have met Taliban on an individual basis, though he would not say who or when

  16. Toxicity can also occur from eating the manure of other animals, such as horses or sheep, after they are treated for parasites with products containing ivermectin

网站地图