go1.10.html 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448
  1. <!--{
  2. "Title": "Go 1.10 Release Notes",
  3. "Path": "/doc/go1.10",
  4. "Template": true
  5. }-->
  6. <!--
  7. NOTE: In this document and others in this directory, the convention is to
  8. set fixed-width phrases with non-fixed-width spaces, as in
  9. <code>hello</code> <code>world</code>.
  10. Do not send CLs removing the interior tags from such phrases.
  11. -->
  12. <style>
  13. main ul li { margin: 0.5em 0; }
  14. </style>
  15. <h2 id="introduction">Introduction to Go 1.10</h2>
  16. <p>
  17. The latest Go release, version 1.10, arrives six months after <a href="go1.9">Go 1.9</a>.
  18. Most of its changes are in the implementation of the toolchain, runtime, and libraries.
  19. As always, the release maintains the Go 1 <a href="/doc/go1compat.html">promise of compatibility</a>.
  20. We expect almost all Go programs to continue to compile and run as before.
  21. </p>
  22. <p>
  23. This release improves <a href="#build">caching of built packages</a>,
  24. adds <a href="#test">caching of successful test results</a>,
  25. runs <a href="#test-vet">vet automatically during tests</a>,
  26. and
  27. permits <a href="#cgo">passing string values directly between Go and C using cgo</a>.
  28. A new <a href="#cgo">compiler option whitelist</a> may cause
  29. unexpected <a href="https://golang.org/s/invalidflag"><code>invalid
  30. flag</code></a> errors in code that built successfully with older
  31. releases.
  32. </p>
  33. <h2 id="language">Changes to the language</h2>
  34. <p>
  35. There are no significant changes to the language specification.
  36. </p>
  37. <p><!-- CL 60230 -->
  38. A corner case involving shifts of untyped constants has been clarified,
  39. and as a result the compilers have been updated to allow the index expression
  40. <code>x[1.0</code>&nbsp;<code>&lt;&lt;</code>&nbsp;<code>s]</code> where <code>s</code> is an unsigned integer;
  41. the <a href="/pkg/go/types/">go/types</a> package already did.
  42. </p>
  43. <p><!-- CL 73233 -->
  44. The grammar for method expressions has been updated to relax the
  45. syntax to allow any type expression as a receiver;
  46. this matches what the compilers were already implementing.
  47. For example, <code>struct{io.Reader}.Read</code> is a valid, if unusual,
  48. method expression that the compilers already accepted and is
  49. now permitted by the language grammar.
  50. </p>
  51. <h2 id="ports">Ports</h2>
  52. <p>
  53. There are no new supported operating systems or processor architectures in this release.
  54. Most of the work has focused on strengthening the support for existing ports,
  55. in particular <a href="#asm">new instructions in the assembler</a>
  56. and improvements to the code generated by the compilers.
  57. </p>
  58. <p id="freebsd">
  59. As <a href="go1.9#freebsd">announced in the Go 1.9 release notes</a>,
  60. Go 1.10 now requires FreeBSD 10.3 or later;
  61. support for FreeBSD 9.3 has been removed.
  62. </p>
  63. <p id="netbsd">
  64. Go now runs on NetBSD again but requires the unreleased NetBSD 8.
  65. Only <code>GOARCH</code> <code>amd64</code> and <code>386</code> have
  66. been fixed. The <code>arm</code> port is still broken.
  67. </p>
  68. <p id="mips">
  69. On 32-bit MIPS systems, the new environment variable settings
  70. <code>GOMIPS=hardfloat</code> (the default) and
  71. <code>GOMIPS=softfloat</code> select whether to use
  72. hardware instructions or software emulation for floating-point computations.
  73. </p>
  74. <p id="openbsd">
  75. Go 1.10 is the last release that will run on OpenBSD 6.0.
  76. Go 1.11 will require OpenBSD 6.2.
  77. </p>
  78. <p id="darwin">
  79. Go 1.10 is the last release that will run on OS X 10.8 Mountain Lion or OS X 10.9 Mavericks.
  80. Go 1.11 will require OS X 10.10 Yosemite or later.
  81. </p>
  82. <p id="windows">
  83. Go 1.10 is the last release that will run on Windows XP or Windows Vista.
  84. Go 1.11 will require Windows 7 or later.
  85. </p>
  86. <h2 id="tools">Tools</h2>
  87. <h3 id="goroot">Default GOROOT &amp; GOTMPDIR</h3>
  88. <p>
  89. If the environment variable <code>$GOROOT</code> is unset,
  90. the go tool previously used the default <code>GOROOT</code>
  91. set during toolchain compilation.
  92. Now, before falling back to that default, the go tool attempts to
  93. deduce <code>GOROOT</code> from its own executable path.
  94. This allows binary distributions to be unpacked anywhere in the
  95. file system and then be used without setting <code>GOROOT</code>
  96. explicitly.
  97. </p>
  98. <p>
  99. By default, the go tool creates its temporary files and directories
  100. in the system temporary directory (for example, <code>$TMPDIR</code> on Unix).
  101. If the new environment variable <code>$GOTMPDIR</code> is set,
  102. the go tool will creates its temporary files and directories in that directory instead.
  103. </p>
  104. <h3 id="build">Build &amp; Install</h3>
  105. <p>
  106. The <code>go</code>&nbsp;<code>build</code> command now detects out-of-date packages
  107. purely based on the content of source files, specified build flags, and metadata stored in the compiled packages.
  108. Modification times are no longer consulted or relevant.
  109. The old advice to add <code>-a</code> to force a rebuild in cases where
  110. the modification times were misleading for one reason or another
  111. (for example, changes in build flags) is no longer necessary:
  112. builds now always detect when packages must be rebuilt.
  113. (If you observe otherwise, please file a bug.)
  114. </p>
  115. <p>
  116. The <code>go</code>&nbsp;<code>build</code> <code>-asmflags</code>, <code>-gcflags</code>, <code>-gccgoflags</code>, and <code>-ldflags</code> options
  117. now apply by default only to the packages listed directly on the command line.
  118. For example, <code>go</code> <code>build</code> <code>-gcflags=-m</code> <code>mypkg</code>
  119. passes the compiler the <code>-m</code> flag when building <code>mypkg</code>
  120. but not its dependencies.
  121. The new, more general form <code>-asmflags=pattern=flags</code> (and similarly for the others)
  122. applies the <code>flags</code> only to the packages matching the pattern.
  123. For example: <code>go</code> <code>install</code> <code>-ldflags=cmd/gofmt=-X=main.version=1.2.3</code> <code>cmd/...</code>
  124. installs all the commands matching <code>cmd/...</code> but only applies the <code>-X</code> option
  125. to the linker flags for <code>cmd/gofmt</code>.
  126. For more details, see <a href="/cmd/go/#hdr-Compile_packages_and_dependencies"><code>go</code> <code>help</code> <code>build</code></a>.
  127. </p>
  128. <p>
  129. The <code>go</code>&nbsp;<code>build</code> command now maintains a cache of
  130. recently built packages, separate from the installed packages in <code>$GOROOT/pkg</code> or <code>$GOPATH/pkg</code>.
  131. The effect of the cache should be to speed builds that do not explicitly install packages
  132. or when switching between different copies of source code (for example, when changing
  133. back and forth between different branches in a version control system).
  134. The old advice to add the <code>-i</code> flag for speed, as in <code>go</code> <code>build</code> <code>-i</code>
  135. or <code>go</code> <code>test</code> <code>-i</code>,
  136. is no longer necessary: builds run just as fast without <code>-i</code>.
  137. For more details, see <a href="/cmd/go/#hdr-Build_and_test_caching"><code>go</code> <code>help</code> <code>cache</code></a>.
  138. </p>
  139. <p>
  140. The <code>go</code>&nbsp;<code>install</code> command now installs only the
  141. packages and commands listed directly on the command line.
  142. For example, <code>go</code> <code>install</code> <code>cmd/gofmt</code>
  143. installs the gofmt program but not any of the packages on which it depends.
  144. The new build cache makes future commands still run as quickly as if the
  145. dependencies had been installed.
  146. To force the installation of dependencies, use the new
  147. <code>go</code> <code>install</code> <code>-i</code> flag.
  148. Installing dependency packages should not be necessary in general,
  149. and the very concept of installed packages may disappear in a future release.
  150. </p>
  151. <p>
  152. Many details of the <code>go</code>&nbsp;<code>build</code> implementation have changed to support these improvements.
  153. One new requirement implied by these changes is that
  154. binary-only packages must now declare accurate import blocks in their
  155. stub source code, so that those imports can be made available when
  156. linking a program using the binary-only package.
  157. For more details, see <a href="/cmd/go/#hdr-File_types"><code>go</code> <code>help</code> <code>filetype</code></a>.
  158. </p>
  159. <h3 id="test">Test</h3>
  160. <p>
  161. The <code>go</code>&nbsp;<code>test</code> command now caches test results:
  162. if the test executable and command line match a previous run
  163. and the files and environment variables consulted by that run
  164. have not changed either, <code>go</code> <code>test</code> will print
  165. the previous test output, replacing the elapsed time with the string “(cached).”
  166. Test caching applies only to successful test results;
  167. only to <code>go</code> <code>test</code>
  168. commands with an explicit list of packages; and
  169. only to command lines using a subset of the
  170. <code>-cpu</code>, <code>-list</code>, <code>-parallel</code>,
  171. <code>-run</code>, <code>-short</code>, and <code>-v</code> test flags.
  172. The idiomatic way to bypass test caching is to use <code>-count=1</code>.
  173. </p>
  174. <p id="test-vet">
  175. The <code>go</code>&nbsp;<code>test</code> command now automatically runs
  176. <code>go</code> <code>vet</code> on the package being tested,
  177. to identify significant problems before running the test.
  178. Any such problems are treated like build errors and prevent execution of the test.
  179. Only a high-confidence subset of the available <code>go</code> <code>vet</code>
  180. checks are enabled for this automatic check.
  181. To disable the running of <code>go</code> <code>vet</code>, use
  182. <code>go</code> <code>test</code> <code>-vet=off</code>.
  183. </p>
  184. <p>
  185. The <code>go</code> <code>test</code> <code>-coverpkg</code> flag now
  186. interprets its argument as a comma-separated list of patterns to match against
  187. the dependencies of each test, not as a list of packages to load anew.
  188. For example, <code>go</code> <code>test</code> <code>-coverpkg=all</code>
  189. is now a meaningful way to run a test with coverage enabled for the test package
  190. and all its dependencies.
  191. Also, the <code>go</code> <code>test</code> <code>-coverprofile</code> option is now
  192. supported when running multiple tests.
  193. </p>
  194. <p>
  195. In case of failure due to timeout, tests are now more likely to write their profiles before exiting.
  196. </p>
  197. <p>
  198. The <code>go</code>&nbsp;<code>test</code> command now always
  199. merges the standard output and standard error from a given test binary execution
  200. and writes both to <code>go</code> <code>test</code>'s standard output.
  201. In past releases, <code>go</code> <code>test</code> only applied this
  202. merging most of the time.
  203. </p>
  204. <p>
  205. The <code>go</code>&nbsp;<code>test</code> <code>-v</code> output
  206. now includes <code>PAUSE</code> and <code>CONT</code> status update
  207. lines to mark when <a href="/pkg/testing/#T.Parallel">parallel tests</a> pause and continue.
  208. </p>
  209. <p>
  210. The new <code>go</code> <code>test</code> <code>-failfast</code> flag
  211. disables running additional tests after any test fails.
  212. Note that tests running in parallel with the failing test are allowed to complete.
  213. </p>
  214. <p>
  215. Finally, the new <code>go</code> <code>test</code> <code>-json</code> flag
  216. filters test output through the new command
  217. <code>go</code> <code>tool</code> <code>test2json</code>
  218. to produce a machine-readable JSON-formatted description of test execution.
  219. This allows the creation of rich presentations of test execution
  220. in IDEs and other tools.
  221. </p>
  222. <p>
  223. For more details about all these changes,
  224. see <a href="/cmd/go/#hdr-Test_packages"><code>go</code> <code>help</code> <code>test</code></a>
  225. and the <a href="/cmd/test2json/">test2json documentation</a>.
  226. </p>
  227. <h3 id="cgo">Cgo</h3>
  228. <p>
  229. Options specified by cgo using <code>#cgo CFLAGS</code> and the like
  230. are now checked against a whitelist of permitted options.
  231. This closes a security hole in which a downloaded package uses
  232. compiler options like
  233. <span style="white-space: nowrap"><code>-fplugin</code></span>
  234. to run arbitrary code on the machine where it is being built.
  235. This can cause a build error such as <code>invalid flag in #cgo CFLAGS</code>.
  236. For more background, and how to handle this error, see
  237. <a href="https://golang.org/s/invalidflag">https://golang.org/s/invalidflag</a>.
  238. </p>
  239. <p>
  240. Cgo now implements a C typedef like “<code>typedef</code> <code>X</code> <code>Y</code>” using a Go type alias,
  241. so that Go code may use the types <code>C.X</code> and <code>C.Y</code> interchangeably.
  242. It also now supports the use of niladic function-like macros.
  243. Also, the documentation has been updated to clarify that
  244. Go structs and Go arrays are not supported in the type signatures of cgo-exported functions.
  245. </p>
  246. <p>
  247. Cgo now supports direct access to Go string values from C.
  248. Functions in the C preamble may use the type <code>_GoString_</code>
  249. to accept a Go string as an argument.
  250. C code may call <code>_GoStringLen</code> and <code>_GoStringPtr</code>
  251. for direct access to the contents of the string.
  252. A value of type <code>_GoString_</code>
  253. may be passed in a call to an exported Go function that takes an argument of Go type <code>string</code>.
  254. </p>
  255. <p>
  256. During toolchain bootstrap, the environment variables <code>CC</code> and <code>CC_FOR_TARGET</code> specify
  257. the default C compiler that the resulting toolchain will use for host and target builds, respectively.
  258. However, if the toolchain will be used with multiple targets, it may be necessary to specify a different C compiler for each
  259. (for example, a different compiler for <code>darwin/arm64</code> versus <code>linux/ppc64le</code>).
  260. The new set of environment variables <code>CC_FOR_<i>goos</i>_<i>goarch</i></code>
  261. allows specifying a different default C compiler for each target.
  262. Note that these variables only apply during toolchain bootstrap,
  263. to set the defaults used by the resulting toolchain.
  264. Later <code>go</code> <code>build</code> commands use the <code>CC</code> environment
  265. variable or else the built-in default.
  266. </p>
  267. <p>
  268. Cgo now translates some C types that would normally map to a pointer
  269. type in Go, to a <code>uintptr</code> instead. These types include
  270. the <code>CFTypeRef</code> hierarchy in Darwin's CoreFoundation
  271. framework and the <code>jobject</code> hierarchy in Java's JNI
  272. interface.
  273. </p>
  274. <p>
  275. These types must be <code>uintptr</code> on the Go side because they
  276. would otherwise confuse the Go garbage collector; they are sometimes
  277. not really pointers but data structures encoded in a pointer-sized integer.
  278. Pointers to Go memory must not be stored in these <code>uintptr</code> values.
  279. </p>
  280. <p>
  281. Because of this change, values of the affected types need to be
  282. zero-initialized with the constant <code>0</code> instead of the
  283. constant <code>nil</code>. Go 1.10 provides <code>gofix</code>
  284. modules to help with that rewrite:
  285. </p>
  286. <pre>
  287. go tool fix -r cftype &lt;pkg&gt;
  288. go tool fix -r jni &lt;pkg&gt;
  289. </pre>
  290. <p>
  291. For more details, see the <a href="/cmd/cgo/">cgo documentation</a>.
  292. </p>
  293. <h3 id="doc">Doc</h3>
  294. <p>
  295. The <code>go</code>&nbsp;<code>doc</code> tool now adds functions returning slices of <code>T</code> or <code>*T</code>
  296. to the display of type <code>T</code>, similar to the existing behavior for functions returning single <code>T</code> or <code>*T</code> results.
  297. For example:
  298. </p>
  299. <pre>
  300. $ go doc mail.Address
  301. package mail // import "net/mail"
  302. type Address struct {
  303. Name string
  304. Address string
  305. }
  306. Address represents a single mail address.
  307. func ParseAddress(address string) (*Address, error)
  308. func ParseAddressList(list string) ([]*Address, error)
  309. func (a *Address) String() string
  310. $
  311. </pre>
  312. <p>
  313. Previously, <code>ParseAddressList</code> was only shown in the package overview (<code>go</code> <code>doc</code> <code>mail</code>).
  314. </p>
  315. <h3 id="fix">Fix</h3>
  316. <p>
  317. The <code>go</code>&nbsp;<code>fix</code> tool now replaces imports of <code>"golang.org/x/net/context"</code>
  318. with <code>"context"</code>.
  319. (Forwarding aliases in the former make it completely equivalent to the latter when using Go 1.9 or later.)
  320. </p>
  321. <h3 id="get">Get</h3>
  322. <p>
  323. The <code>go</code>&nbsp;<code>get</code> command now supports Fossil source code repositories.
  324. </p>
  325. <h3 id="pprof">Pprof</h3>
  326. <p>
  327. The blocking and mutex profiles produced by the <code>runtime/pprof</code> package
  328. now include symbol information, so they can be viewed
  329. in <code>go</code> <code>tool</code> <code>pprof</code>
  330. without the binary that produced the profile.
  331. (All other profile types were changed to include symbol information in Go 1.9.)
  332. </p>
  333. <p>
  334. The <a href="/cmd/pprof/"><code>go</code>&nbsp;<code>tool</code>&nbsp;<code>pprof</code></a>
  335. profile visualizer has been updated to git version 9e20b5b (2017-11-08)
  336. from <a href="https://github.com/google/pprof">github.com/google/pprof</a>,
  337. which includes an updated web interface.
  338. </p>
  339. <h3 id="vet">Vet</h3>
  340. <p>
  341. The <a href="/cmd/vet/"><code>go</code>&nbsp;<code>vet</code></a> command now always has access to
  342. complete, up-to-date type information when checking packages, even for packages using cgo or vendored imports.
  343. The reports should be more accurate as a result.
  344. Note that only <code>go</code>&nbsp;<code>vet</code> has access to this information;
  345. the more low-level <code>go</code>&nbsp;<code>tool</code>&nbsp;<code>vet</code> does not
  346. and should be avoided except when working on <code>vet</code> itself.
  347. (As of Go 1.9, <code>go</code>&nbsp;<code>vet</code> provides access to all the same flags as
  348. <code>go</code>&nbsp;<code>tool</code>&nbsp;<code>vet</code>.)
  349. </p>
  350. <h3 id="diag">Diagnostics</h3>
  351. <p>
  352. This release includes a new <a href="/doc/diagnostics.html">overview of available Go program diagnostic tools</a>.
  353. </p>
  354. <h3 id="gofmt">Gofmt</h3>
  355. <p>
  356. Two minor details of the default formatting of Go source code have changed.
  357. First, certain complex three-index slice expressions previously formatted like
  358. <code>x[i+1</code>&nbsp;<code>:</code>&nbsp;<code>j:k]</code> and now
  359. format with more consistent spacing: <code>x[i+1</code>&nbsp;<code>:</code>&nbsp;<code>j</code>&nbsp;<code>:</code>&nbsp;<code>k]</code>.
  360. Second, single-method interface literals written on a single line,
  361. which are sometimes used in type assertions,
  362. are no longer split onto multiple lines.
  363. </p>
  364. <p>
  365. Note that these kinds of minor updates to gofmt are expected from time to time.
  366. In general, we recommend against building systems that check that source code
  367. matches the output of a specific version of gofmt.
  368. For example, a continuous integration test that fails if any code already checked into
  369. a repository is not “properly formatted” is inherently fragile and not recommended.
  370. </p>
  371. <p>
  372. If multiple programs must agree about which version of gofmt is used to format a source file,
  373. we recommend that they do this by arranging to invoke the same gofmt binary.
  374. For example, in the Go open source repository, our Git pre-commit hook is written in Go
  375. and could import <code>go/format</code> directly, but instead it invokes the <code>gofmt</code>
  376. binary found in the current path, so that the pre-commit hook need not be recompiled
  377. each time <code>gofmt</code> changes.
  378. </p>
  379. <h3 id="compiler">Compiler Toolchain</h3>
  380. <p>
  381. The compiler includes many improvements to the performance of generated code,
  382. spread fairly evenly across the supported architectures.
  383. </p>
  384. <p>
  385. The DWARF debug information recorded in binaries has been improved in a few ways:
  386. constant values are now recorded;
  387. line number information is more accurate, making source-level stepping through a program work better;
  388. and each package is now presented as its own DWARF compilation unit.
  389. </p>
  390. <p>
  391. The various <a href="https://docs.google.com/document/d/1nr-TQHw_er6GOQRsF6T43GGhFDelrAP0NqSS_00RgZQ/edit">build modes</a>
  392. have been ported to more systems.
  393. Specifically, <code>c-shared</code> now works on <code>linux/ppc64le</code>, <code>windows/386</code>, and <code>windows/amd64</code>;
  394. <code>pie</code> now works on <code>darwin/amd64</code> and also forces the use of external linking on all systems;
  395. and <code>plugin</code> now works on <code>linux/ppc64le</code> and <code>darwin/amd64</code>.
  396. </p>
  397. <p>
  398. The <code>linux/ppc64le</code> port now requires the use of external linking
  399. with any programs that use cgo, even uses by the standard library.
  400. </p>
  401. <h3 id="asm">Assembler</h3>
  402. <p>
  403. For the ARM 32-bit port, the assembler now supports the instructions
  404. <code><small>BFC</small></code>,
  405. <code><small>BFI</small></code>,
  406. <code><small>BFX</small></code>,
  407. <code><small>BFXU</small></code>,
  408. <code><small>FMULAD</small></code>,
  409. <code><small>FMULAF</small></code>,
  410. <code><small>FMULSD</small></code>,
  411. <code><small>FMULSF</small></code>,
  412. <code><small>FNMULAD</small></code>,
  413. <code><small>FNMULAF</small></code>,
  414. <code><small>FNMULSD</small></code>,
  415. <code><small>FNMULSF</small></code>,
  416. <code><small>MULAD</small></code>,
  417. <code><small>MULAF</small></code>,
  418. <code><small>MULSD</small></code>,
  419. <code><small>MULSF</small></code>,
  420. <code><small>NMULAD</small></code>,
  421. <code><small>NMULAF</small></code>,
  422. <code><small>NMULD</small></code>,
  423. <code><small>NMULF</small></code>,
  424. <code><small>NMULSD</small></code>,
  425. <code><small>NMULSF</small></code>,
  426. <code><small>XTAB</small></code>,
  427. <code><small>XTABU</small></code>,
  428. <code><small>XTAH</small></code>,
  429. and
  430. <code><small>XTAHU</small></code>.
  431. </p>
  432. <p>
  433. For the ARM 64-bit port, the assembler now supports the
  434. <code><small>VADD</small></code>,
  435. <code><small>VADDP</small></code>,
  436. <code><small>VADDV</small></code>,
  437. <code><small>VAND</small></code>,
  438. <code><small>VCMEQ</small></code>,
  439. <code><small>VDUP</small></code>,
  440. <code><small>VEOR</small></code>,
  441. <code><small>VLD1</small></code>,
  442. <code><small>VMOV</small></code>,
  443. <code><small>VMOVI</small></code>,
  444. <code><small>VMOVS</small></code>,
  445. <code><small>VORR</small></code>,
  446. <code><small>VREV32</small></code>,
  447. and
  448. <code><small>VST1</small></code>
  449. instructions.
  450. </p>
  451. <p>
  452. For the PowerPC 64-bit port, the assembler now supports the POWER9 instructions
  453. <code><small>ADDEX</small></code>,
  454. <code><small>CMPEQB</small></code>,
  455. <code><small>COPY</small></code>,
  456. <code><small>DARN</small></code>,
  457. <code><small>LDMX</small></code>,
  458. <code><small>MADDHD</small></code>,
  459. <code><small>MADDHDU</small></code>,
  460. <code><small>MADDLD</small></code>,
  461. <code><small>MFVSRLD</small></code>,
  462. <code><small>MTVSRDD</small></code>,
  463. <code><small>MTVSRWS</small></code>,
  464. <code><small>PASTECC</small></code>,
  465. <code><small>VCMPNEZB</small></code>,
  466. <code><small>VCMPNEZBCC</small></code>,
  467. and
  468. <code><small>VMSUMUDM</small></code>.
  469. </p>
  470. <p>
  471. For the S390X port, the assembler now supports the
  472. <code><small>TMHH</small></code>,
  473. <code><small>TMHL</small></code>,
  474. <code><small>TMLH</small></code>,
  475. and
  476. <code><small>TMLL</small></code>
  477. instructions.
  478. </p>
  479. <p>
  480. For the X86 64-bit port, the assembler now supports 359 new instructions,
  481. including the full AVX, AVX2, BMI, BMI2, F16C, FMA3, SSE2, SSE3, SSSE3, SSE4.1, and SSE4.2 extension sets.
  482. The assembler also no longer implements <code><small>MOVL</small></code>&nbsp;<code><small>$0,</small></code>&nbsp;<code><small>AX</small></code>
  483. as an <code><small>XORL</small></code> instruction,
  484. to avoid clearing the condition flags unexpectedly.
  485. </p>
  486. <h3 id="gccgo">Gccgo</h3>
  487. <p>
  488. Due to the alignment of Go's semiannual release schedule with GCC's
  489. annual release schedule,
  490. GCC release 7 contains the Go 1.8.3 version of gccgo.
  491. We expect that the next release, GCC 8, will contain the Go 1.10
  492. version of gccgo.
  493. </p>
  494. <h2 id="runtime">Runtime</h2>
  495. <p>
  496. The behavior of nested calls to
  497. <a href="/pkg/runtime/#LockOSThread"><code>LockOSThread</code></a> and
  498. <a href="/pkg/runtime/#UnlockOSThread"><code>UnlockOSThread</code></a>
  499. has changed.
  500. These functions control whether a goroutine is locked to a specific operating system thread,
  501. so that the goroutine only runs on that thread, and the thread only runs that goroutine.
  502. Previously, calling <code>LockOSThread</code> more than once in a row
  503. was equivalent to calling it once, and a single <code>UnlockOSThread</code>
  504. always unlocked the thread.
  505. Now, the calls nest: if <code>LockOSThread</code> is called multiple times,
  506. <code>UnlockOSThread</code> must be called the same number of times
  507. in order to unlock the thread.
  508. Existing code that was careful not to nest these calls will remain correct.
  509. Existing code that incorrectly assumed the calls nested will become correct.
  510. Most uses of these functions in public Go source code falls into the second category.
  511. </p>
  512. <p>
  513. Because one common use of <code>LockOSThread</code> and <code>UnlockOSThread</code>
  514. is to allow Go code to reliably modify thread-local state (for example, Linux or Plan 9 name spaces),
  515. the runtime now treats locked threads as unsuitable for reuse or for creating new threads.
  516. </p>
  517. <p>
  518. Stack traces no longer include implicit wrapper functions (previously marked <code>&lt;autogenerated&gt;</code>),
  519. unless a fault or panic happens in the wrapper itself.
  520. As a result, skip counts passed to functions like <a href="/pkg/runtime/#Caller"><code>Caller</code></a>
  521. should now always match the structure of the code as written, rather than depending on
  522. optimization decisions and implementation details.
  523. </p>
  524. <p>
  525. The garbage collector has been modified to reduce its impact on allocation latency.
  526. It now uses a smaller fraction of the overall CPU when running, but it may run more of the time.
  527. The total CPU consumed by the garbage collector has not changed significantly.
  528. </p>
  529. <p>
  530. The <a href="/pkg/runtime/#GOROOT"><code>GOROOT</code></a> function
  531. now defaults (when the <code>$GOROOT</code> environment variable is not set)
  532. to the <code>GOROOT</code> or <code>GOROOT_FINAL</code> in effect
  533. at the time the calling program was compiled.
  534. Previously it used the <code>GOROOT</code> or <code>GOROOT_FINAL</code> in effect
  535. at the time the toolchain that compiled the calling program was compiled.
  536. </p>
  537. <p>
  538. There is no longer a limit on the <a href="/pkg/runtime/#GOMAXPROCS"><code>GOMAXPROCS</code></a> setting.
  539. (In Go 1.9 the limit was 1024.)
  540. </p>
  541. <h2 id="performance">Performance</h2>
  542. <p>
  543. As always, the changes are so general and varied that precise
  544. statements about performance are difficult to make. Most programs
  545. should run a bit faster, due to speedups in the garbage collector,
  546. better generated code, and optimizations in the core library.
  547. </p>
  548. <h2 id="gc">Garbage Collector</h2>
  549. <p>
  550. Many applications should experience significantly lower allocation latency and overall performance overhead when the garbage collector is active.
  551. </p>
  552. <h2 id="library">Core library</h2>
  553. <p>
  554. All of the changes to the standard library are minor.
  555. The changes in <a href="#bytes">bytes</a>
  556. and <a href="#net/url">net/url</a> are the most likely to require updating of existing programs.
  557. </p>
  558. <h3 id="minor_library_changes">Minor changes to the library</h3>
  559. <p>
  560. As always, there are various minor changes and updates to the library,
  561. made with the Go 1 <a href="/doc/go1compat">promise of compatibility</a>
  562. in mind.
  563. </p>
  564. <dl id="archive/tar"><dt><a href="/pkg/archive/tar/">archive/tar</a></dt>
  565. <dd>
  566. <p>
  567. In general, the handling of special header formats is significantly improved and expanded.
  568. </p>
  569. <p>
  570. <a href="/pkg/archive/tar/#FileInfoHeader"><code>FileInfoHeader</code></a> has always
  571. recorded the Unix UID and GID numbers from its <a href="/pkg/os/#FileInfo"><code>os.FileInfo</code></a> argument
  572. (specifically, from the system-dependent information returned by the <code>FileInfo</code>'s <code>Sys</code> method)
  573. in the returned <a href="/pkg/archive/tar/#Header"><code>Header</code></a>.
  574. Now it also records the user and group names corresponding to those IDs,
  575. as well as the major and minor device numbers for device files.
  576. </p>
  577. <p>
  578. The new <a href="/pkg/archive/tar/#Header"><code>Header.Format</code></a> field
  579. of type <a href="/pkg/archive/tar/#Format"><code>Format</code></a>
  580. controls which tar header format the <a href="/pkg/archive/tar/#Writer"><code>Writer</code></a> uses.
  581. The default, as before, is to select the most widely-supported header type
  582. that can encode the fields needed by the header (USTAR if possible, or else PAX if possible, or else GNU).
  583. The <a href="/pkg/archive/tar/#Reader"><code>Reader</code></a> sets <code>Header.Format</code> for each header it reads.
  584. </p>
  585. <p>
  586. <code>Reader</code> and the <code>Writer</code> now support arbitrary PAX records,
  587. using the new <a href="/pkg/archive/tar/#Header"><code>Header.PAXRecords</code></a> field,
  588. a generalization of the existing <code>Xattrs</code> field.
  589. </p>
  590. <p>
  591. The <code>Reader</code> no longer insists that the file name or link name in GNU headers
  592. be valid UTF-8.
  593. </p>
  594. <p>
  595. When writing PAX- or GNU-format headers, the <code>Writer</code> now includes
  596. the <code>Header.AccessTime</code> and <code>Header.ChangeTime</code> fields (if set).
  597. When writing PAX-format headers, the times include sub-second precision.
  598. </p>
  599. </dl>
  600. <dl id="archive/zip"><dt><a href="/pkg/archive/zip/">archive/zip</a></dt>
  601. <dd>
  602. <p>
  603. Go 1.10 adds more complete support for times and character set encodings in ZIP archives.
  604. </p>
  605. <p>
  606. The original ZIP format used the standard MS-DOS encoding of year, month, day, hour, minute, and second into fields in two 16-bit values.
  607. That encoding cannot represent time zones or odd seconds, so multiple extensions have been
  608. introduced to allow richer encodings.
  609. In Go 1.10, the <a href="/pkg/archive/zip/#Reader"><code>Reader</code></a> and <a href="/pkg/archive/zip/#Writer"><code>Writer</code></a>
  610. now support the widely-understood Info-Zip extension that encodes the time separately in the 32-bit Unix “seconds since epoch” form.
  611. The <a href="/pkg/archive/zip/#FileHeader"><code>FileHeader</code></a>'s new <code>Modified</code> field of type <a href="/pkg/time/#Time"><code>time.Time</code></a>
  612. obsoletes the <code>ModifiedTime</code> and <code>ModifiedDate</code> fields, which continue to hold the MS-DOS encoding.
  613. The <code>Reader</code> and <code>Writer</code> now adopt the common
  614. convention that a ZIP archive storing a time zone-independent Unix time
  615. also stores the local time in the MS-DOS field,
  616. so that the time zone offset can be inferred.
  617. For compatibility, the <a href="/pkg/archive/zip/#FileHeader.ModTime"><code>ModTime</code></a> and
  618. <a href="/pkg/archive/zip/#FileHeader.SetModTime"><code>SetModTime</code></a> methods
  619. behave the same as in earlier releases; new code should use <code>Modified</code> directly.
  620. </p>
  621. <p>
  622. The header for each file in a ZIP archive has a flag bit indicating whether
  623. the name and comment fields are encoded as UTF-8, as opposed to a system-specific default encoding.
  624. In Go 1.8 and earlier, the <code>Writer</code> never set the UTF-8 bit.
  625. In Go 1.9, the <code>Writer</code> changed to set the UTF-8 bit almost always.
  626. This broke the creation of ZIP archives containing Shift-JIS file names.
  627. In Go 1.10, the <code>Writer</code> now sets the UTF-8 bit only when
  628. both the name and the comment field are valid UTF-8 and at least one is non-ASCII.
  629. Because non-ASCII encodings very rarely look like valid UTF-8, the new
  630. heuristic should be correct nearly all the time.
  631. Setting a <code>FileHeader</code>'s new <code>NonUTF8</code> field to true
  632. disables the heuristic entirely for that file.
  633. </p>
  634. <p>
  635. The <code>Writer</code> also now supports setting the end-of-central-directory record's comment field,
  636. by calling the <code>Writer</code>'s new <a href="/pkg/archive/zip/#Writer.SetComment"><code>SetComment</code></a> method.
  637. </p>
  638. </dl>
  639. <dl id="bufio"><dt><a href="/pkg/bufio/">bufio</a></dt>
  640. <dd>
  641. <p>
  642. The new <a href="/pkg/bufio/#Reader.Size"><code>Reader.Size</code></a>
  643. and <a href="/pkg/bufio/#Writer.Size"><code>Writer.Size</code></a>
  644. methods report the <code>Reader</code> or <code>Writer</code>'s underlying buffer size.
  645. </p>
  646. </dl>
  647. <dl id="bytes"><dt><a href="/pkg/bytes/">bytes</a></dt>
  648. <dd>
  649. <p>
  650. The
  651. <a href="/pkg/bytes/#Fields"><code>Fields</code></a>,
  652. <a href="/pkg/bytes/#FieldsFunc"><code>FieldsFunc</code></a>,
  653. <a href="/pkg/bytes/#Split"><code>Split</code></a>,
  654. and
  655. <a href="/pkg/bytes/#SplitAfter"><code>SplitAfter</code></a>
  656. functions have always returned subslices of their inputs.
  657. Go 1.10 changes each returned subslice to have capacity equal to its length,
  658. so that appending to one cannot overwrite adjacent data in the original input.
  659. </p>
  660. </dl>
  661. <dl id="crypto/cipher"><dt><a href="/pkg/crypto/cipher/">crypto/cipher</a></dt>
  662. <dd>
  663. <p>
  664. <a href="/pkg/crypto/cipher/#NewOFB"><code>NewOFB</code></a> now panics if given
  665. an initialization vector of incorrect length, like the other constructors in the
  666. package always have.
  667. (Previously it returned a nil <code>Stream</code> implementation.)
  668. </p>
  669. </dl>
  670. <dl id="crypto/tls"><dt><a href="/pkg/crypto/tls/">crypto/tls</a></dt>
  671. <dd>
  672. <p>
  673. The TLS server now advertises support for SHA-512 signatures when using TLS 1.2.
  674. The server already supported the signatures, but some clients would not select
  675. them unless explicitly advertised.
  676. </p>
  677. </dl>
  678. <dl id="crypto/x509"><dt><a href="/pkg/crypto/x509/">crypto/x509</a></dt>
  679. <dd>
  680. <p>
  681. <a href="/pkg/crypto/x509/#Certificate.Verify"><code>Certificate.Verify</code></a>
  682. now enforces the name constraints for all
  683. names contained in the certificate, not just the one name that a client has asked about.
  684. Extended key usage restrictions are similarly now checked all at once.
  685. As a result, after a certificate has been validated, now it can be trusted in its entirety.
  686. It is no longer necessary to revalidate the certificate for each additional name
  687. or key usage.
  688. </p>
  689. <p>
  690. Parsed certificates also now report URI names and IP, email, and URI constraints, using the new
  691. <a href="/pkg/crypto/x509/#Certificate"><code>Certificate</code></a> fields
  692. <code>URIs</code>, <code>PermittedIPRanges</code>, <code>ExcludedIPRanges</code>,
  693. <code>PermittedEmailAddresses</code>, <code>ExcludedEmailAddresses</code>,
  694. <code>PermittedURIDomains</code>, and <code>ExcludedURIDomains</code>. Certificates with
  695. invalid values for those fields are now rejected.
  696. </p>
  697. <p>
  698. The new <a href="/pkg/crypto/x509/#MarshalPKCS1PublicKey"><code>MarshalPKCS1PublicKey</code></a>
  699. and <a href="/pkg/crypto/x509/#ParsePKCS1PublicKey"><code>ParsePKCS1PublicKey</code></a>
  700. functions convert an RSA public key to and from PKCS#1-encoded form.
  701. </p>
  702. <p>
  703. The new <a href="/pkg/crypto/x509/#MarshalPKCS8PrivateKey"><code>MarshalPKCS8PrivateKey</code></a>
  704. function converts a private key to PKCS#8-encoded form.
  705. (<a href="/pkg/crypto/x509/#ParsePKCS8PrivateKey"><code>ParsePKCS8PrivateKey</code></a>
  706. has existed since Go 1.)
  707. </p>
  708. </dl>
  709. <dl id="crypto/x509/pkix"><dt><a href="/pkg/crypto/x509/pkix/">crypto/x509/pkix</a></dt>
  710. <dd>
  711. <p>
  712. <a href="/pkg/crypto/x509/pkix/#Name"><code>Name</code></a> now implements a
  713. <a href="/pkg/crypto/x509/pkix/#Name.String"><code>String</code></a> method that
  714. formats the X.509 distinguished name in the standard RFC 2253 format.
  715. </p>
  716. </dl>
  717. <dl id="database/sql/driver"><dt><a href="/pkg/database/sql/driver/">database/sql/driver</a></dt>
  718. <dd>
  719. <p>
  720. Drivers that currently hold on to the destination buffer provided by
  721. <a href="/pkg/database/sql/driver/#Rows.Next"><code>driver.Rows.Next</code></a> should ensure they no longer
  722. write to a buffer assigned to the destination array outside of that call.
  723. Drivers must be careful that underlying buffers are not modified when closing
  724. <a href="/pkg/database/sql/driver/#Rows"><code>driver.Rows</code></a>.
  725. </p>
  726. <p>
  727. Drivers that want to construct a <a href="/pkg/database/sql/#DB"><code>sql.DB</code></a> for
  728. their clients can now implement the <a href="/pkg/database/sql/driver/#Connector"><code>Connector</code></a> interface
  729. and call the new <a href="/pkg/database/sql/#OpenDB"><code>sql.OpenDB</code></a> function,
  730. instead of needing to encode all configuration into a string
  731. passed to <a href="/pkg/database/sql/#Open"><code>sql.Open</code></a>.
  732. </p>
  733. <p>
  734. Drivers that want to parse the configuration string only once per <code>sql.DB</code>
  735. instead of once per <a href="/pkg/database/sql/#Conn"><code>sql.Conn</code></a>,
  736. or that want access to each <code>sql.Conn</code>'s underlying context,
  737. can make their <a href="/pkg/database/sql/driver/#Driver"><code>Driver</code></a>
  738. implementations also implement <a href="/pkg/database/sql/driver/#DriverContext"><code>DriverContext</code></a>'s
  739. new <code>OpenConnector</code> method.
  740. </p>
  741. <p>
  742. Drivers that implement <a href="/pkg/database/sql/driver/#ExecerContext"><code>ExecerContext</code></a>
  743. no longer need to implement <a href="/pkg/database/sql/driver/#Execer"><code>Execer</code></a>;
  744. similarly, drivers that implement <a href="/pkg/database/sql/driver/#QueryerContext"><code>QueryerContext</code></a>
  745. no longer need to implement <a href="/pkg/database/sql/driver/#Queryer"><code>Queryer</code></a>.
  746. Previously, even if the context-based interfaces were implemented they were ignored
  747. unless the non-context-based interfaces were also implemented.
  748. </p>
  749. <p>
  750. To allow drivers to better isolate different clients using a cached driver connection in succession,
  751. if a <a href="/pkg/database/sql/driver/#Conn"><code>Conn</code></a> implements the new
  752. <a href="/pkg/database/sql/driver/#SessionResetter"><code>SessionResetter</code></a> interface,
  753. <code>database/sql</code> will now call <code>ResetSession</code> before
  754. reusing the <code>Conn</code> for a new client.
  755. </p>
  756. </dl>
  757. <dl id="debug/elf"><dt><a href="/pkg/debug/elf/">debug/elf</a></dt>
  758. <dd>
  759. <p>
  760. This release adds 348 new relocation constants divided between the relocation types
  761. <a href="/pkg/debug/elf/#R_386"><code>R_386</code></a>,
  762. <a href="/pkg/debug/elf/#R_AARCH64"><code>R_AARCH64</code></a>,
  763. <a href="/pkg/debug/elf/#R_ARM"><code>R_ARM</code></a>,
  764. <a href="/pkg/debug/elf/#R_PPC64"><code>R_PPC64</code></a>,
  765. and
  766. <a href="/pkg/debug/elf/#R_X86_64"><code>R_X86_64</code></a>.
  767. </p>
  768. </dl>
  769. <dl id="debug/macho"><dt><a href="/pkg/debug/macho/">debug/macho</a></dt>
  770. <dd>
  771. <p>
  772. Go 1.10 adds support for reading relocations from Mach-O sections,
  773. using the <a href="/pkg/debug/macho#Section"><code>Section</code></a> struct's new <code>Relocs</code> field
  774. and the new <a href="/pkg/debug/macho/#Reloc"><code>Reloc</code></a>,
  775. <a href="/pkg/debug/macho/#RelocTypeARM"><code>RelocTypeARM</code></a>,
  776. <a href="/pkg/debug/macho/#RelocTypeARM64"><code>RelocTypeARM64</code></a>,
  777. <a href="/pkg/debug/macho/#RelocTypeGeneric"><code>RelocTypeGeneric</code></a>,
  778. and
  779. <a href="/pkg/debug/macho/#RelocTypeX86_64"><code>RelocTypeX86_64</code></a>
  780. types and associated constants.
  781. </p>
  782. <p>
  783. Go 1.10 also adds support for the <code>LC_RPATH</code> load command,
  784. represented by the types
  785. <a href="/pkg/debug/macho/#RpathCmd"><code>RpathCmd</code></a> and
  786. <a href="/pkg/debug/macho/#Rpath"><code>Rpath</code></a>,
  787. and new <a href="/pkg/debug/macho/#pkg-constants">named constants</a>
  788. for the various flag bits found in headers.
  789. </p>
  790. </dl>
  791. <dl id="encoding/asn1"><dt><a href="/pkg/encoding/asn1/">encoding/asn1</a></dt>
  792. <dd>
  793. <p>
  794. <a href="/pkg/encoding/asn1/#Marshal"><code>Marshal</code></a> now correctly encodes
  795. strings containing asterisks as type UTF8String instead of PrintableString,
  796. unless the string is in a struct field with a tag forcing the use of PrintableString.
  797. <code>Marshal</code> also now respects struct tags containing <code>application</code> directives.
  798. </p>
  799. <p>
  800. The new <a href="/pkg/encoding/asn1/#MarshalWithParams"><code>MarshalWithParams</code></a>
  801. function marshals its argument as if the additional params were its associated
  802. struct field tag.
  803. </p>
  804. <p>
  805. <a href="/pkg/encoding/asn1/#Unmarshal"><code>Unmarshal</code></a> now respects
  806. struct field tags using the <code>explicit</code> and <code>tag</code>
  807. directives.
  808. </p>
  809. <p>
  810. Both <code>Marshal</code> and <code>Unmarshal</code> now support a new struct field tag
  811. <code>numeric</code>, indicating an ASN.1 NumericString.
  812. </p>
  813. </dl>
  814. <dl id="encoding/csv"><dt><a href="/pkg/encoding/csv/">encoding/csv</a></dt>
  815. <dd>
  816. <p>
  817. <a href="/pkg/encoding/csv/#Reader"><code>Reader</code></a> now disallows the use of
  818. nonsensical <code>Comma</code> and <code>Comment</code> settings,
  819. such as NUL, carriage return, newline, invalid runes, and the Unicode replacement character,
  820. or setting <code>Comma</code> and <code>Comment</code> equal to each other.
  821. </p>
  822. <p>
  823. In the case of a syntax error in a CSV record that spans multiple input lines, <code>Reader</code>
  824. now reports the line on which the record started in the <a href="/pkg/encoding/csv/#ParseError"><code>ParseError</code></a>'s new <code>StartLine</code> field.
  825. </p>
  826. </dl>
  827. <dl id="encoding/hex"><dt><a href="/pkg/encoding/hex/">encoding/hex</a></dt>
  828. <dd>
  829. <p>
  830. The new functions
  831. <a href="/pkg/encoding/hex/#NewEncoder"><code>NewEncoder</code></a>
  832. and
  833. <a href="/pkg/encoding/hex/#NewDecoder"><code>NewDecoder</code></a>
  834. provide streaming conversions to and from hexadecimal,
  835. analogous to equivalent functions already in
  836. <a href="/pkg/encoding/base32/">encoding/base32</a>
  837. and
  838. <a href="/pkg/encoding/base64/">encoding/base64</a>.
  839. </p>
  840. <p>
  841. When the functions
  842. <a href="/pkg/encoding/hex/#Decode"><code>Decode</code></a>
  843. and
  844. <a href="/pkg/encoding/hex/#DecodeString"><code>DecodeString</code></a>
  845. encounter malformed input,
  846. they now return the number of bytes already converted
  847. along with the error.
  848. Previously they always returned a count of 0 with any error.
  849. </p>
  850. </dl>
  851. <dl id="encoding/json"><dt><a href="/pkg/encoding/json/">encoding/json</a></dt>
  852. <dd>
  853. <p>
  854. The <a href="/pkg/encoding/json/#Decoder"><code>Decoder</code></a>
  855. adds a new method
  856. <a href="/pkg/encoding/json/#Decoder.DisallowUnknownFields"><code>DisallowUnknownFields</code></a>
  857. that causes it to report inputs with unknown JSON fields as a decoding error.
  858. (The default behavior has always been to discard unknown fields.)
  859. </p>
  860. <p>
  861. As a result of <a href="#reflect">fixing a reflect bug</a>,
  862. <a href="/pkg/encoding/json/#Unmarshal"><code>Unmarshal</code></a>
  863. can no longer decode into fields inside
  864. embedded pointers to unexported struct types,
  865. because it cannot initialize the unexported embedded pointer
  866. to point at fresh storage.
  867. <code>Unmarshal</code> now returns an error in this case.
  868. </p>
  869. </dl>
  870. <dl id="encoding/pem"><dt><a href="/pkg/encoding/pem/">encoding/pem</a></dt>
  871. <dd>
  872. <p>
  873. <a href="/pkg/encoding/pem/#Encode"><code>Encode</code></a>
  874. and
  875. <a href="/pkg/encoding/pem/#EncodeToMemory"><code>EncodeToMemory</code></a>
  876. no longer generate partial output when presented with a
  877. block that is impossible to encode as PEM data.
  878. </p>
  879. </dl>
  880. <dl id="encoding/xml"><dt><a href="/pkg/encoding/xml/">encoding/xml</a></dt>
  881. <dd>
  882. <p>
  883. The new function
  884. <a href="/pkg/encoding/xml/#NewTokenDecoder"><code>NewTokenDecoder</code></a>
  885. is like
  886. <a href="/pkg/encoding/xml/#NewDecoder"><code>NewDecoder</code></a>
  887. but creates a decoder reading from a <a href="/pkg/encoding/xml/#TokenReader"><code>TokenReader</code></a>
  888. instead of an XML-formatted byte stream.
  889. This is meant to enable the construction of XML stream transformers in client libraries.
  890. </p>
  891. </dl>
  892. <dl id="flag"><dt><a href="/pkg/flag/">flag</a></dt>
  893. <dd>
  894. <p>
  895. The default
  896. <a href="/pkg/flag/#Usage"><code>Usage</code></a> function now prints
  897. its first line of output to
  898. <code>CommandLine.Output()</code>
  899. instead of assuming <code>os.Stderr</code>,
  900. so that the usage message is properly redirected for
  901. clients using <code>CommandLine.SetOutput</code>.
  902. </p>
  903. <p>
  904. <a href="/pkg/flag/#PrintDefaults"><code>PrintDefaults</code></a> now
  905. adds appropriate indentation after newlines in flag usage strings,
  906. so that multi-line usage strings display nicely.
  907. </p>
  908. <p>
  909. <a href="/pkg/flag/#FlagSet"><code>FlagSet</code></a> adds new methods
  910. <a href="/pkg/flag/#FlagSet.ErrorHandling"><code>ErrorHandling</code></a>,
  911. <a href="/pkg/flag/#FlagSet.Name"><code>Name</code></a>,
  912. and
  913. <a href="/pkg/flag/#FlagSet.Output"><code>Output</code></a>,
  914. to retrieve the settings passed to
  915. <a href="/pkg/flag/#NewFlagSet"><code>NewFlagSet</code></a>
  916. and
  917. <a href="/pkg/flag/#FlagSet.SetOutput"><code>FlagSet.SetOutput</code></a>.
  918. </p>
  919. </dl>
  920. <dl id="go/doc"><dt><a href="/pkg/go/doc/">go/doc</a></dt>
  921. <dd>
  922. <p>
  923. To support the <a href="#doc">doc change</a> described above,
  924. functions returning slices of <code>T</code>, <code>*T</code>, <code>**T</code>, and so on
  925. are now reported in <code>T</code>'s <a href="/pkg/go/doc/#Type"><code>Type</code></a>'s <code>Funcs</code> list,
  926. instead of in the <a href="/pkg/go/doc/#Package"><code>Package</code></a>'s <code>Funcs</code> list.
  927. </p>
  928. </dl>
  929. <dl id="go/importer"><dt><a href="/pkg/go/importer/">go/importer</a></dt>
  930. <dd>
  931. <p>
  932. The <a href="/pkg/go/importer/#For"><code>For</code></a> function now accepts a non-nil lookup argument.
  933. </p>
  934. </dl>
  935. <dl id="go/printer"><dt><a href="/pkg/go/printer/">go/printer</a></dt>
  936. <dd>
  937. <p>
  938. The changes to the default formatting of Go source code
  939. discussed in the <a href="#gofmt">gofmt section</a> above
  940. are implemented in the <a href="/pkg/go/printer/">go/printer</a> package
  941. and also affect the output of the higher-level <a href="/pkg/go/format/">go/format</a> package.
  942. </p>
  943. </dl>
  944. <dl id="hash"><dt><a href="/pkg/hash/">hash</a></dt>
  945. <dd>
  946. <p>
  947. Implementations of the <a href="/pkg/hash/#Hash"><code>Hash</code></a> interface are now
  948. encouraged to implement <a href="/pkg/encoding/#BinaryMarshaler"><code>encoding.BinaryMarshaler</code></a>
  949. and <a href="/pkg/encoding/#BinaryUnmarshaler"><code>encoding.BinaryUnmarshaler</code></a>
  950. to allow saving and recreating their internal state,
  951. and all implementations in the standard library
  952. (<a href="/pkg/hash/crc32/">hash/crc32</a>, <a href="/pkg/crypto/sha256/">crypto/sha256</a>, and so on)
  953. now implement those interfaces.
  954. </p>
  955. </dl>
  956. <dl id="html/template"><dt><a href="/pkg/html/template/">html/template</a></dt>
  957. <dd>
  958. <p>
  959. The new <a href="/pkg/html/template#Srcset"><code>Srcset</code></a> content
  960. type allows for proper handling of values within the
  961. <a href="https://w3c.github.io/html/semantics-embedded-content.html#element-attrdef-img-srcset"><code>srcset</code></a>
  962. attribute of <code>img</code> tags.
  963. </p>
  964. </dl>
  965. <dl id="math/big"><dt><a href="/pkg/math/big/">math/big</a></dt>
  966. <dd>
  967. <p>
  968. <a href="/pkg/math/big/#Int"><code>Int</code></a> now supports conversions to and from bases 2 through 62
  969. in its <a href="/pkg/math/big/#Int.SetString"><code>SetString</code></a> and <a href="/pkg/math/big/#Text"><code>Text</code></a> methods.
  970. (Previously it only allowed bases 2 through 36.)
  971. The value of the constant <code>MaxBase</code> has been updated.
  972. </p>
  973. <p>
  974. <a href="/pkg/math/big/#Int"><code>Int</code></a> adds a new
  975. <a href="/pkg/math/big/#CmpAbs"><code>CmpAbs</code></a> method
  976. that is like <a href="/pkg/math/big/#Cmp"><code>Cmp</code></a> but
  977. compares only the absolute values (not the signs) of its arguments.
  978. </p>
  979. <p>
  980. <a href="/pkg/math/big/#Float"><code>Float</code></a> adds a new
  981. <a href="/pkg/math/big/#Float.Sqrt"><code>Sqrt</code></a> method to
  982. compute square roots.
  983. </p>
  984. </dl>
  985. <dl id="math/cmplx"><dt><a href="/pkg/math/cmplx/">math/cmplx</a></dt>
  986. <dd>
  987. <p>
  988. Branch cuts and other boundary cases in
  989. <a href="/pkg/math/cmplx/#Asin"><code>Asin</code></a>,
  990. <a href="/pkg/math/cmplx/#Asinh"><code>Asinh</code></a>,
  991. <a href="/pkg/math/cmplx/#Atan"><code>Atan</code></a>,
  992. and
  993. <a href="/pkg/math/cmplx/#Sqrt"><code>Sqrt</code></a>
  994. have been corrected to match the definitions used in the C99 standard.
  995. </p>
  996. </dl>
  997. <dl id="math/rand"><dt><a href="/pkg/math/rand/">math/rand</a></dt>
  998. <dd>
  999. <p>
  1000. The new <a href="/pkg/math/rand/#Shuffle"><code>Shuffle</code></a> function and corresponding
  1001. <a href="/pkg/math/rand/#Rand.Shuffle"><code>Rand.Shuffle</code></a> method
  1002. shuffle an input sequence.
  1003. </p>
  1004. </dl>
  1005. <dl id="math"><dt><a href="/pkg/math/">math</a></dt>
  1006. <dd>
  1007. <p>
  1008. The new functions
  1009. <a href="/pkg/math/#Round"><code>Round</code></a>
  1010. and
  1011. <a href="/pkg/math/#RoundToEven"><code>RoundToEven</code></a>
  1012. round their arguments to the nearest floating-point integer;
  1013. <code>Round</code> rounds a half-integer to its larger integer neighbor (away from zero)
  1014. while <code>RoundToEven</code> rounds a half-integer to its even integer neighbor.
  1015. </p>
  1016. <p>
  1017. The new functions
  1018. <a href="/pkg/math/#Erfinv"><code>Erfinv</code></a>
  1019. and
  1020. <a href="/pkg/math/#Erfcinv"><code>Erfcinv</code></a>
  1021. compute the inverse error function and the
  1022. inverse complementary error function.
  1023. </p>
  1024. </dl>
  1025. <dl id="mime/multipart"><dt><a href="/pkg/mime/multipart/">mime/multipart</a></dt>
  1026. <dd>
  1027. <p>
  1028. <a href="/pkg/mime/multipart/#Reader"><code>Reader</code></a>
  1029. now accepts parts with empty filename attributes.
  1030. </p>
  1031. </dl>
  1032. <dl id="mime"><dt><a href="/pkg/mime/">mime</a></dt>
  1033. <dd>
  1034. <p>
  1035. <a href="/pkg/mime/#ParseMediaType"><code>ParseMediaType</code></a> now discards
  1036. invalid attribute values; previously it returned those values as empty strings.
  1037. </p>
  1038. </dl>
  1039. <dl id="net"><dt><a href="/pkg/net/">net</a></dt>
  1040. <dd>
  1041. <p>
  1042. The <a href="/pkg/net/#Conn"><code>Conn</code></a> and
  1043. <a href="/pkg/net/#Conn"><code>Listener</code></a> implementations
  1044. in this package now guarantee that when <code>Close</code> returns,
  1045. the underlying file descriptor has been closed.
  1046. (In earlier releases, if the <code>Close</code> stopped pending I/O
  1047. in other goroutines, the closing of the file descriptor could happen in one of those
  1048. goroutines shortly after <code>Close</code> returned.)
  1049. </p>
  1050. <p>
  1051. <a href="/pkg/net/#TCPListener"><code>TCPListener</code></a> and
  1052. <a href="/pkg/net/#UnixListener"><code>UnixListener</code></a>
  1053. now implement
  1054. <a href="/pkg/syscall/#Conn"><code>syscall.Conn</code></a>,
  1055. to allow setting options on the underlying file descriptor
  1056. using <a href="/pkg/syscall/#RawConn"><code>syscall.RawConn.Control</code></a>.
  1057. </p>
  1058. <p>
  1059. The <code>Conn</code> implementations returned by <a href="/pkg/net/#Pipe"><code>Pipe</code></a>
  1060. now support setting read and write deadlines.
  1061. </p>
  1062. <p>
  1063. The <a href="/pkg/net/#IPConn.ReadMsgIP"><code>IPConn.ReadMsgIP</code></a>,
  1064. <a href="/pkg/net/#IPConn.WriteMsgIP"><code>IPConn.WriteMsgIP</code></a>,
  1065. <a href="/pkg/net/#UDPConn.ReadMsgUDP"><code>UDPConn.ReadMsgUDP</code></a>,
  1066. and
  1067. <a href="/pkg/net/#UDPConn.WriteMsgUDP"><code>UDPConn.WriteMsgUDP</code></a>,
  1068. methods are now implemented on Windows.
  1069. </p>
  1070. </dl>
  1071. <dl id="net/http"><dt><a href="/pkg/net/http/">net/http</a></dt>
  1072. <dd>
  1073. <p>
  1074. On the client side, an HTTP proxy (most commonly configured by
  1075. <a href="/pkg/net/http/#ProxyFromEnvironment"><code>ProxyFromEnvironment</code></a>)
  1076. can now be specified as an <code>https://</code> URL,
  1077. meaning that the client connects to the proxy over HTTPS before issuing a standard, proxied HTTP request.
  1078. (Previously, HTTP proxy URLs were required to begin with <code>http://</code> or <code>socks5://</code>.)
  1079. </p>
  1080. <p>
  1081. On the server side, <a href="/pkg/net/http/#FileServer"><code>FileServer</code></a> and its single-file equivalent <a href="/pkg/net/http/#ServeFile"><code>ServeFile</code></a>
  1082. now apply <code>If-Range</code> checks to <code>HEAD</code> requests.
  1083. <code>FileServer</code> also now reports directory read failures to the <a href="/pkg/net/http/#Server"><code>Server</code></a>'s <code>ErrorLog</code>.
  1084. The content-serving handlers also now omit the <code>Content-Type</code> header when serving zero-length content.
  1085. </p>
  1086. <p>
  1087. <a href="/pkg/net/http/#ResponseWriter"><code>ResponseWriter</code></a>'s <code>WriteHeader</code> method now panics
  1088. if passed an invalid (non-3-digit) status code.
  1089. </p>
  1090. <p>
  1091. <!-- CL 46631 -->
  1092. The <code>Server</code> will no longer add an implicit Content-Type when a <code>Handler</code> does not write any output.
  1093. </p>
  1094. <p>
  1095. <a href="/pkg/net/http/#Redirect"><code>Redirect</code></a> now sets the <code>Content-Type</code> header before writing its HTTP response.
  1096. </p>
  1097. </dl>
  1098. <dl id="net/mail"><dt><a href="/pkg/net/mail/">net/mail</a></dt>
  1099. <dd>
  1100. <p>
  1101. <a href="/pkg/net/mail/#ParseAddress"><code>ParseAddress</code></a> and
  1102. <a href="/pkg/net/mail/#ParseAddressList"><code>ParseAddressList</code></a>
  1103. now support a variety of obsolete address formats.
  1104. </p>
  1105. </dl>
  1106. <dl id="net/smtp"><dt><a href="/pkg/net/smtp/">net/smtp</a></dt>
  1107. <dd>
  1108. <p>
  1109. The <a href="/pkg/net/smtp/#Client"><code>Client</code></a> adds a new
  1110. <a href="/pkg/net/smtp/#Client.Noop"><code>Noop</code></a> method,
  1111. to test whether the server is still responding.
  1112. It also now defends against possible SMTP injection in the inputs
  1113. to the <a href="/pkg/net/smtp/#Client.Hello"><code>Hello</code></a>
  1114. and <a href="/pkg/net/smtp/#Client.Verify"><code>Verify</code></a> methods.
  1115. </p>
  1116. </dl>
  1117. <dl id="net/textproto"><dt><a href="/pkg/net/textproto/">net/textproto</a></dt>
  1118. <dd>
  1119. <p>
  1120. <a href="/pkg/net/textproto/#ReadMIMEHeader"><code>ReadMIMEHeader</code></a>
  1121. now rejects any header that begins with a continuation (indented) header line.
  1122. Previously a header with an indented first line was treated as if the first line
  1123. were not indented.
  1124. </p>
  1125. </dl>
  1126. <dl id="net/url"><dt><a href="/pkg/net/url/">net/url</a></dt>
  1127. <dd>
  1128. <p>
  1129. <a href="/pkg/net/url/#ResolveReference"><code>ResolveReference</code></a>
  1130. now preserves multiple leading slashes in the target URL.
  1131. Previously it rewrote multiple leading slashes to a single slash,
  1132. which resulted in the <a href="/pkg/net/http/#Client"><code>http.Client</code></a>
  1133. following certain redirects incorrectly.
  1134. </p>
  1135. <p>
  1136. For example, this code's output has changed:
  1137. </p>
  1138. <pre>
  1139. base, _ := url.Parse("http://host//path//to/page1")
  1140. target, _ := url.Parse("page2")
  1141. fmt.Println(base.ResolveReference(target))
  1142. </pre>
  1143. <p>
  1144. Note the doubled slashes around <code>path</code>.
  1145. In Go 1.9 and earlier, the resolved URL was <code>http://host/path//to/page2</code>:
  1146. the doubled slash before <code>path</code> was incorrectly rewritten
  1147. to a single slash, while the doubled slash after <code>path</code> was
  1148. correctly preserved.
  1149. Go 1.10 preserves both doubled slashes, resolving to <code>http://host//path//to/page2</code>
  1150. as required by <a href="https://tools.ietf.org/html/rfc3986#section-5.2">RFC 3986</a>.
  1151. </p>
  1152. <p>This change may break existing buggy programs that unintentionally
  1153. construct a base URL with a leading doubled slash in the path and inadvertently
  1154. depend on <code>ResolveReference</code> to correct that mistake.
  1155. For example, this can happen if code adds a host prefix
  1156. like <code>http://host/</code> to a path like <code>/my/api</code>,
  1157. resulting in a URL with a doubled slash: <code>http://host//my/api</code>.
  1158. </p>
  1159. <p>
  1160. <a href="/pkg/net/url/#UserInfo"><code>UserInfo</code></a>'s methods
  1161. now treat a nil receiver as equivalent to a pointer to a zero <code>UserInfo</code>.
  1162. Previously, they panicked.
  1163. </p>
  1164. </dl>
  1165. <dl id="os"><dt><a href="/pkg/os/">os</a></dt>
  1166. <dd>
  1167. <p>
  1168. <a href="/pkg/os/#File"><code>File</code></a> adds new methods
  1169. <a href="/pkg/os/#File.SetDeadline"><code>SetDeadline</code></a>,
  1170. <a href="/pkg/os/#File.SetReadDeadline"><code>SetReadDeadline</code></a>,
  1171. and
  1172. <a href="/pkg/os/#File.SetWriteDeadline"><code>SetWriteDeadline</code></a>
  1173. that allow setting I/O deadlines when the
  1174. underlying file descriptor supports non-blocking I/O operations.
  1175. The definition of these methods matches those in <a href="/pkg/net/#Conn"><code>net.Conn</code></a>.
  1176. If an I/O method fails due to missing a deadline, it will return a
  1177. timeout error; the
  1178. new <a href="/pkg/os/#IsTimeout"><code>IsTimeout</code></a> function
  1179. reports whether an error represents a timeout.
  1180. </p>
  1181. <p>
  1182. Also matching <code>net.Conn</code>,
  1183. <code>File</code>'s
  1184. <a href="/pkg/os/#File.Close"><code>Close</code></a> method
  1185. now guarantee that when <code>Close</code> returns,
  1186. the underlying file descriptor has been closed.
  1187. (In earlier releases,
  1188. if the <code>Close</code> stopped pending I/O
  1189. in other goroutines, the closing of the file descriptor could happen in one of those
  1190. goroutines shortly after <code>Close</code> returned.)
  1191. </p>
  1192. <p>
  1193. On BSD, macOS, and Solaris systems,
  1194. <a href="/pkg/os/#Chtimes"><code>Chtimes</code></a>
  1195. now supports setting file times with nanosecond precision
  1196. (assuming the underlying file system can represent them).
  1197. </p>
  1198. </dl>
  1199. <dl id="reflect"><dt><a href="/pkg/reflect/">reflect</a></dt>
  1200. <dd>
  1201. <p>
  1202. The <a href="/pkg/reflect/#Copy"><code>Copy</code></a> function now allows copying
  1203. from a string into a byte array or byte slice, to match the
  1204. <a href="/pkg/builtin/#copy">built-in copy function</a>.
  1205. </p>
  1206. <p>
  1207. In structs, embedded pointers to unexported struct types were
  1208. previously incorrectly reported with an empty <code>PkgPath</code>
  1209. in the corresponding <a href="/pkg/reflect/#StructField">StructField</a>,
  1210. with the result that for those fields,
  1211. and <a href="/pkg/reflect/#Value.CanSet"><code>Value.CanSet</code></a>
  1212. incorrectly returned true and
  1213. <a href="/pkg/reflect/#Value.Set"><code>Value.Set</code></a>
  1214. incorrectly succeeded.
  1215. The underlying metadata has been corrected;
  1216. for those fields,
  1217. <code>CanSet</code> now correctly returns false
  1218. and <code>Set</code> now correctly panics.
  1219. This may affect reflection-based unmarshalers
  1220. that could previously unmarshal into such fields
  1221. but no longer can.
  1222. For example, see the <a href="#encoding/json"><code>encoding/json</code> notes</a>.
  1223. </p>
  1224. </dl>
  1225. <dl id="runtime/pprof"><dt><a href="/pkg/runtime/pprof/">runtime/pprof</a></dt>
  1226. <dd>
  1227. <p>
  1228. As <a href="#pprof">noted above</a>, the blocking and mutex profiles
  1229. now include symbol information so that they can be viewed without needing
  1230. the binary that generated them.
  1231. </p>
  1232. </dl>
  1233. <dl id="strconv"><dt><a href="/pkg/strconv/">strconv</a></dt>
  1234. <dd>
  1235. <p>
  1236. <a href="/pkg/strconv/#ParseUint"><code>ParseUint</code></a> now returns
  1237. the maximum magnitude integer of the appropriate size
  1238. with any <code>ErrRange</code> error, as it was already documented to do.
  1239. Previously it returned 0 with <code>ErrRange</code> errors.
  1240. </p>
  1241. </dl>
  1242. <dl id="strings"><dt><a href="/pkg/strings/">strings</a></dt>
  1243. <dd>
  1244. <p>
  1245. A new type
  1246. <a href="/pkg/strings/#Builder"><code>Builder</code></a> is a replacement for
  1247. <a href="/pkg/bytes/#Buffer"><code>bytes.Buffer</code></a> for the use case of
  1248. accumulating text into a <code>string</code> result.
  1249. The <code>Builder</code>'s API is a restricted subset of <code>bytes.Buffer</code>'s
  1250. that allows it to safely avoid making a duplicate copy of the data
  1251. during the <a href="/pkg/strings/#Builder.String"><code>String</code></a> method.
  1252. </p>
  1253. </dl>
  1254. <dl id="syscall"><dt><a href="/pkg/syscall/">syscall</a></dt>
  1255. <dd>
  1256. <p>
  1257. On Windows,
  1258. the new <a href="/pkg/syscall/#SysProcAttr"><code>SysProcAttr</code></a> field <code>Token</code>,
  1259. of type <a href="/pkg/syscall/#Token"><code>Token</code></a> allows the creation of a process that
  1260. runs as another user during <a href="/pkg/syscall/#StartProcess"><code>StartProcess</code></a>
  1261. (and therefore also during <a href="/pkg/os/#StartProcess"><code>os.StartProcess</code></a> and
  1262. <a href="/pkg/os/exec/#Cmd.Start"><code>exec.Cmd.Start</code></a>).
  1263. The new function <a href="/pkg/syscall/#CreateProcessAsUser"><code>CreateProcessAsUser</code></a>
  1264. gives access to the underlying system call.
  1265. </p>
  1266. <p>
  1267. On BSD, macOS, and Solaris systems, <a href="/pkg/syscall/#UtimesNano"><code>UtimesNano</code></a>
  1268. is now implemented.
  1269. </p>
  1270. </dl>
  1271. <dl id="time"><dt><a href="/pkg/time/">time</a></dt>
  1272. <dd>
  1273. <p>
  1274. <a href="/pkg/time/#LoadLocation"><code>LoadLocation</code></a> now uses the directory
  1275. or uncompressed zip file named by the <code>$ZONEINFO</code>
  1276. environment variable before looking in the default system-specific list of
  1277. known installation locations or in <code>$GOROOT/lib/time/zoneinfo.zip</code>.
  1278. </p>
  1279. <p>
  1280. The new function <a href="/pkg/time/#LoadLocationFromTZData"><code>LoadLocationFromTZData</code></a>
  1281. allows conversion of IANA time zone file data to a <a href="/pkg/time/#Location"><code>Location</code></a>.
  1282. </p>
  1283. </dl>
  1284. <dl id="unicode"><dt><a href="/pkg/unicode/">unicode</a></dt>
  1285. <dd>
  1286. <p>
  1287. The <a href="/pkg/unicode/"><code>unicode</code></a> package and associated
  1288. support throughout the system has been upgraded from Unicode 9.0 to
  1289. <a href="http://www.unicode.org/versions/Unicode10.0.0/">Unicode 10.0</a>,
  1290. which adds 8,518 new characters, including four new scripts, one new property,
  1291. a Bitcoin currency symbol, and 56 new emoji.
  1292. </p>
  1293. </dl>