"Fossies" - the Fresh Open Source Software Archive

Member "go/doc/go1.11.html" (9 Sep 2020, 36327 Bytes) of package /windows/misc/go1.14.9.windows-386.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <!--{
    2     "Title": "Go 1.11 Release Notes",
    3     "Path":  "/doc/go1.11",
    4     "Template": true
    5 }-->
    6 
    7 <!--
    8 NOTE: In this document and others in this directory, the convention is to
    9 set fixed-width phrases with non-fixed-width spaces, as in
   10 <code>hello</code> <code>world</code>.
   11 Do not send CLs removing the interior tags from such phrases.
   12 -->
   13 
   14 <style>
   15   main ul li { margin: 0.5em 0; }
   16 </style>
   17 
   18 <h2 id="introduction">Introduction to Go 1.11</h2>
   19 
   20 <p>
   21   The latest Go release, version 1.11, arrives six months after <a href="go1.10">Go 1.10</a>.
   22   Most of its changes are in the implementation of the toolchain, runtime, and libraries.
   23   As always, the release maintains the Go 1 <a href="/doc/go1compat.html">promise of compatibility</a>.
   24   We expect almost all Go programs to continue to compile and run as before.
   25 </p>
   26 
   27 <h2 id="language">Changes to the language</h2>
   28 
   29 <p>
   30   There are no changes to the language specification.
   31 </p>
   32 
   33 <h2 id="ports">Ports</h2>
   34 
   35 <p> <!-- CL 94255, CL 115038, etc -->
   36   As <a href="go1.10#ports">announced in the Go 1.10 release notes</a>, Go 1.11 now requires
   37   OpenBSD 6.2 or later, macOS 10.10 Yosemite or later, or Windows 7 or later;
   38   support for previous versions of these operating systems has been removed.
   39 </p>
   40 
   41 <p> <!-- CL 121657 -->
   42   Go 1.11 supports the upcoming OpenBSD 6.4 release. Due to changes in
   43   the OpenBSD kernel, older versions of Go will not work on OpenBSD 6.4.
   44 </p>
   45 
   46 <p>
   47   There are <a href="https://golang.org/issue/25206">known issues</a> with NetBSD on i386 hardware.
   48 </p>
   49 
   50 <p><!-- CL 107935 -->
   51   The race detector is now supported on <code>linux/ppc64le</code>
   52   and, to a lesser extent, on <code>netbsd/amd64</code>. The NetBSD race detector support
   53   has <a href="https://golang.org/issue/26403">known issues</a>.
   54 </p>
   55 
   56 <p><!-- CL 109255 -->
   57   The memory sanitizer (<code>-msan</code>) is now supported on <code>linux/arm64</code>.
   58 </p>
   59 
   60 <p><!-- CL 93875 -->
   61   The build modes <code>c-shared</code> and <code>c-archive</code> are now supported on
   62   <code>freebsd/amd64</code>.
   63 </p>
   64 
   65 <p id="mips"><!-- CL 108475 -->
   66   On 64-bit MIPS systems, the new environment variable settings
   67   <code>GOMIPS64=hardfloat</code> (the default) and
   68   <code>GOMIPS64=softfloat</code> select whether to use
   69   hardware instructions or software emulation for floating-point computations.
   70   For 32-bit systems, the environment variable is still <code>GOMIPS</code>,
   71   as <a href="go1.10#mips">added in Go 1.10</a>.
   72 </p>
   73 
   74 <p><!-- CL 107475 -->
   75   On soft-float ARM systems (<code>GOARM=5</code>), Go now uses a more
   76   efficient software floating point interface. This is transparent to
   77   Go code, but ARM assembly that uses floating-point instructions not
   78   guarded on GOARM will break and must be ported to
   79   the <a href="https://golang.org/cl/107475">new interface</a>.
   80 </p>
   81 
   82 <p><!-- CL 94076 -->
   83   Go 1.11 on ARMv7 no longer requires a Linux kernel configured
   84   with <code>KUSER_HELPERS</code>. This setting is enabled in default
   85   kernel configurations, but is sometimes disabled in stripped-down
   86   configurations.
   87 </p>
   88 
   89 <h3 id="wasm">WebAssembly</h3>
   90 <p>
   91   Go 1.11 adds an experimental port to <a href="https://webassembly.org">WebAssembly</a>
   92   (<code>js/wasm</code>).
   93 </p>
   94 <p>
   95   Go programs currently compile to one WebAssembly module that
   96   includes the Go runtime for goroutine scheduling, garbage
   97   collection, maps, etc.
   98   As a result, the resulting size is at minimum around
   99   2 MB, or 500 KB compressed. Go programs can call into JavaScript
  100   using the new experimental
  101   <a href="/pkg/syscall/js/"><code>syscall/js</code></a> package.
  102   Binary size and interop with other languages has not yet been a
  103   priority but may be addressed in future releases.
  104 </p>
  105 <p>
  106   As a result of the addition of the new <code>GOOS</code> value
  107   "<code>js</code>" and <code>GOARCH</code> value "<code>wasm</code>",
  108   Go files named <code>*_js.go</code> or <code>*_wasm.go</code> will
  109   now be <a href="/pkg/go/build/#hdr-Build_Constraints">ignored by Go
  110   tools</a> except when those GOOS/GOARCH values are being used.
  111   If you have existing filenames matching those patterns, you will need to rename them.
  112 </p>
  113 <p>
  114   More information can be found on the
  115   <a href="https://golang.org/wiki/WebAssembly">WebAssembly wiki page</a>.
  116 </p>
  117 
  118 <h3 id="riscv">RISC-V GOARCH values reserved</h3>
  119 <p><!-- CL 106256 -->
  120   The main Go compiler does not yet support the RISC-V architecture <!-- is gonna change everything -->
  121   but we've reserved the <code>GOARCH</code> values
  122   "<code>riscv</code>" and "<code>riscv64</code>", as used by Gccgo,
  123   which does support RISC-V. This means that Go files
  124   named <code>*_riscv.go</code> will now also
  125   be <a href="/pkg/go/build/#hdr-Build_Constraints">ignored by Go
  126   tools</a> except when those GOOS/GOARCH values are being used.
  127 </p>
  128 
  129 <h2 id="tools">Tools</h2>
  130 
  131 <h3 id="modules">Modules, package versioning, and dependency management</h3>
  132 <p>
  133   Go 1.11 adds preliminary support for a <a href="/cmd/go/#hdr-Modules__module_versions__and_more">new concept called “modules,”</a>
  134   an alternative to GOPATH with integrated support for versioning and
  135   package distribution.
  136   Using modules, developers are no longer confined to working inside GOPATH,
  137   version dependency information is explicit yet lightweight,
  138   and builds are more reliable and reproducible.
  139 </p>
  140 
  141 <p>
  142   Module support is considered experimental.
  143   Details are likely to change in response to feedback from Go 1.11 users,
  144   and we have more tools planned.
  145   Although the details of module support may change, projects that convert
  146   to modules using Go 1.11 will continue to work with Go 1.12 and later.
  147   If you encounter bugs using modules,
  148   please <a href="https://golang.org/issue/new">file issues</a>
  149   so we can fix them. For more information, see the
  150   <a href="/cmd/go#hdr-Modules__module_versions__and_more"><code>go</code> command documentation</a>.
  151 </p>
  152 
  153 <h3 id="importpath">Import path restriction</h3>
  154 
  155 <p>
  156   Because Go module support assigns special meaning to the
  157   <code>@</code> symbol in command line operations,
  158   the <code>go</code> command now disallows the use of
  159   import paths containing <code>@</code> symbols.
  160   Such import paths were never allowed by <code>go</code> <code>get</code>,
  161   so this restriction can only affect users building
  162   custom GOPATH trees by other means.
  163 </p>
  164 
  165 <h3 id="gopackages">Package loading</h3>
  166 
  167 <p>
  168   The new package
  169   <a href="https://godoc.org/golang.org/x/tools/go/packages"><code>golang.org/x/tools/go/packages</code></a>
  170   provides a simple API for locating and loading packages of Go source code.
  171   Although not yet part of the standard library, for many tasks it
  172   effectively replaces the <a href="/pkg/go/build"><code>go/build</code></a>
  173   package, whose API is unable to fully support modules.
  174   Because it runs an external query command such as
  175   <a href="/cmd/go/#hdr-List_packages"><code>go list</code></a>
  176   to obtain information about Go packages, it enables the construction of
  177   analysis tools that work equally well with alternative build systems
  178   such as <a href="https://bazel.build">Bazel</a>
  179   and <a href="https://buckbuild.com">Buck</a>.
  180 </p>
  181 
  182 <h3 id="gocache">Build cache requirement</h3>
  183 
  184 <p>
  185   Go 1.11 will be the last release to support setting the environment
  186   variable <code>GOCACHE=off</code> to disable the
  187   <a href="/cmd/go/#hdr-Build_and_test_caching">build cache</a>,
  188   introduced in Go 1.10.
  189   Starting in Go 1.12, the build cache will be required,
  190   as a step toward eliminating <code>$GOPATH/pkg</code>.
  191   The module and package loading support described above
  192   already require that the build cache be enabled.
  193   If you have disabled the build cache to avoid problems you encountered,
  194   please <a href="https://golang.org/issue/new">file an issue</a> to let us know about them.
  195 </p>
  196 
  197 <h3 id="compiler">Compiler toolchain</h3>
  198 
  199 <p><!-- CL 109918 -->
  200   More functions are now eligible for inlining by default, including
  201   functions that call <code>panic</code>.
  202 </p>
  203 
  204 <p><!-- CL 97375 -->
  205   The compiler toolchain now supports column information
  206   in <a href="/cmd/compile/#hdr-Compiler_Directives">line
  207   directives</a>.
  208 </p>
  209 
  210 <p><!-- CL 106797 -->
  211   A new package export data format has been introduced.
  212   This should be transparent to end users, except for speeding up
  213   build times for large Go projects.
  214   If it does cause problems, it can be turned off again by
  215   passing <code>-gcflags=all=-iexport=false</code> to
  216   the <code>go</code> tool when building a binary.
  217 </p>
  218 
  219 <p><!-- CL 100459 -->
  220   The compiler now rejects unused variables declared in a type switch
  221   guard, such as <code>x</code> in the following example:
  222 </p>
  223 <pre>
  224 func f(v interface{}) {
  225     switch x := v.(type) {
  226     }
  227 }
  228 </pre>
  229 <p>
  230   This was already rejected by both <code>gccgo</code>
  231   and <a href="/pkg/go/types/">go/types</a>.
  232 </p>
  233 
  234 <h3 id="assembler">Assembler</h3>
  235 
  236 <p><!-- CL 113315 -->
  237   The assembler for <code>amd64</code> now accepts AVX512 instructions.
  238 </p>
  239 
  240 <h3 id="debugging">Debugging</h3>
  241 
  242 <p><!-- CL 100738, CL 93664 -->
  243   The compiler now produces significantly more accurate debug
  244   information for optimized binaries, including variable location
  245   information, line numbers, and breakpoint locations.
  246 
  247   This should make it possible to debug binaries
  248   compiled <em>without</em> <code>-N</code>&nbsp;<code>-l</code>.
  249 
  250   There are still limitations to the quality of the debug information,
  251   some of which are fundamental, and some of which will continue to
  252   improve with future releases.
  253 </p>
  254 
  255 <p><!-- CL 118276 -->
  256   DWARF sections are now compressed by default because of the expanded
  257   and more accurate debug information produced by the compiler.
  258 
  259   This is transparent to most ELF tools (such as debuggers on Linux
  260   and *BSD) and is supported by the Delve debugger on all platforms,
  261   but has limited support in the native tools on macOS and Windows.
  262 
  263   To disable DWARF compression,
  264   pass <code>-ldflags=-compressdwarf=false</code> to
  265   the <code>go</code> tool when building a binary.
  266 </p>
  267 
  268 <p><!-- CL 109699 -->
  269   Go 1.11 adds experimental support for calling Go functions from
  270   within a debugger.
  271 
  272   This is useful, for example, to call <code>String</code> methods
  273   when paused at a breakpoint.
  274 
  275   This is currently only supported by Delve (version 1.1.0 and up).
  276 </p>
  277 
  278 <h3 id="test">Test</h3>
  279 
  280 <p>
  281   Since Go 1.10, the <code>go</code>&nbsp;<code>test</code> command runs
  282   <code>go</code>&nbsp;<code>vet</code> on the package being tested,
  283   to identify problems before running the test. Since <code>vet</code>
  284   typechecks the code with <a href="/pkg/go/types/">go/types</a>
  285   before running, tests that do not typecheck will now fail.
  286 
  287   In particular, tests that contain an unused variable inside a
  288   closure compiled with Go 1.10, because the Go compiler incorrectly
  289   accepted them (<a href="https://golang.org/issues/3059">Issue #3059</a>),
  290   but will now fail, since <code>go/types</code> correctly reports an
  291   "unused variable" error in this case.
  292 </p>
  293 
  294 <p><!-- CL 102696 -->
  295   The <code>-memprofile</code> flag
  296   to <code>go</code>&nbsp;<code>test</code> now defaults to the
  297   "allocs" profile, which records the total bytes allocated since the
  298   test began (including garbage-collected bytes).
  299 </p>
  300 
  301 <h3 id="vet">Vet</h3>
  302 
  303 <p><!-- CL 108555 -->
  304   The <a href="/cmd/vet/"><code>go</code>&nbsp;<code>vet</code></a>
  305   command now reports a fatal error when the package under analysis
  306   does not typecheck. Previously, a type checking error simply caused
  307   a warning to be printed, and <code>vet</code> to exit with status 1.
  308 </p>
  309 
  310 <p><!-- CL 108559 -->
  311   Additionally, <a href="/cmd/vet"><code>go</code>&nbsp;<code>vet</code></a>
  312   has become more robust when format-checking <code>printf</code> wrappers.
  313   Vet now detects the mistake in this example:
  314 </p>
  315 
  316 <pre>
  317 func wrapper(s string, args ...interface{}) {
  318     fmt.Printf(s, args...)
  319 }
  320 
  321 func main() {
  322     wrapper("%s", 42)
  323 }
  324 </pre>
  325 
  326 <h3 id="trace">Trace</h3>
  327 
  328 <p><!-- CL 63274 -->
  329   With the new <code>runtime/trace</code>
  330   package's <a href="/pkg/runtime/trace/#hdr-User_annotation">user
  331   annotation API</a>, users can record application-level information
  332   in execution traces and create groups of related goroutines.
  333   The <code>go</code>&nbsp;<code>tool</code>&nbsp;<code>trace</code>
  334   command visualizes this information in the trace view and the new
  335   user task/region analysis page.
  336 </p>
  337 
  338 <h3 id="cgo">Cgo</h3>
  339 
  340 <p>
  341 Since Go 1.10, cgo has translated some C pointer types to the Go
  342 type <code>uintptr</code>. These types include
  343 the <code>CFTypeRef</code> hierarchy in Darwin's CoreFoundation
  344 framework and the <code>jobject</code> hierarchy in Java's JNI
  345 interface. In Go 1.11, several improvements have been made to the code
  346 that detects these types. Code that uses these types may need some
  347 updating. See the <a href="go1.10.html#cgo">Go 1.10 release notes</a> for
  348 details. <!-- CL 126275, CL 127156, CL 122217, CL 122575, CL 123177 -->
  349 </p>
  350 
  351 <h3 id="go_command">Go command</h3>
  352 
  353 <p><!-- CL 126656 -->
  354   The environment variable <code>GOFLAGS</code> may now be used
  355   to set default flags for the <code>go</code> command.
  356   This is useful in certain situations.
  357   Linking can be noticeably slower on underpowered systems due to DWARF,
  358   and users may want to set <code>-ldflags=-w</code> by default.
  359   For modules, some users and CI systems will want vendoring always,
  360   so they should set <code>-mod=vendor</code> by default.
  361   For more information, see the <a href="/cmd/go/#hdr-Environment_variables"><code>go</code>
  362   command documentation</a>.
  363 </p>
  364 
  365 <h3 id="godoc">Godoc</h3>
  366 
  367 <p>
  368   Go 1.11 will be the last release to support <code>godoc</code>'s command-line interface.
  369   In future releases, <code>godoc</code> will only be a web server. Users should use
  370   <code>go</code> <code>doc</code> for command-line help output instead.
  371 </p>
  372 
  373 <p><!-- CL 85396, CL 124495 -->
  374   The <code>godoc</code> web server now shows which version of Go introduced
  375   new API features. The initial Go version of types, funcs, and methods are shown
  376   right-aligned. For example, see <a href="/pkg/os/#UserCacheDir"><code>UserCacheDir</code></a>, with "1.11"
  377   on the right side. For struct fields, inline comments are added when the struct field was
  378   added in a Go version other than when the type itself was introduced.
  379   For a struct field example, see
  380   <a href="/pkg/net/http/httptrace/#ClientTrace.Got1xxResponse"><code>ClientTrace.Got1xxResponse</code></a>.
  381 </p>
  382 
  383 <h3 id="gofmt">Gofmt</h3>
  384 
  385 <p>
  386   One minor detail of the default formatting of Go source code has changed.
  387   When formatting expression lists with inline comments, the comments were
  388   aligned according to a heuristic.
  389   However, in some cases the alignment would be split up too easily, or
  390   introduce too much whitespace.
  391   The heuristic has been changed to behave better for human-written code.
  392 </p>
  393 
  394 <p>
  395   Note that these kinds of minor updates to gofmt are expected from time to
  396   time.
  397   In general, systems that need consistent formatting of Go source code should
  398   use a specific version of the <code>gofmt</code> binary.
  399   See the <a href="/pkg/go/format/">go/format</a> package documentation for more
  400   information.
  401 </p>
  402 
  403 <h3 id="run">Run</h3>
  404 
  405 <p>
  406   <!-- CL 109341 -->
  407   The <a href="/cmd/go/"><code>go</code>&nbsp;<code>run</code></a>
  408   command now allows a single import path, a directory name or a
  409   pattern matching a single package.
  410   This allows <code>go</code>&nbsp;<code>run</code>&nbsp;<code>pkg</code> or <code>go</code>&nbsp;<code>run</code>&nbsp;<code>dir</code>, most importantly <code>go</code>&nbsp;<code>run</code>&nbsp;<code>.</code>
  411 </p>
  412 
  413 <h2 id="runtime">Runtime</h2>
  414 
  415 <p><!-- CL 85887 -->
  416   The runtime now uses a sparse heap layout so there is no longer a
  417   limit to the size of the Go heap (previously, the limit was 512GiB).
  418   This also fixes rare "address space conflict" failures in mixed Go/C
  419   binaries or binaries compiled with <code>-race</code>.
  420 </p>
  421 
  422 <p><!-- CL 108679, CL 106156 -->
  423   On macOS and iOS, the runtime now uses <code>libSystem.dylib</code> instead of
  424   calling the kernel directly. This should make Go binaries more
  425   compatible with future versions of macOS and iOS.
  426   The <a href="/pkg/syscall">syscall</a> package still makes direct
  427   system calls; fixing this is planned for a future release.
  428 </p>
  429 
  430 <h2 id="performance">Performance</h2>
  431 
  432 <p>
  433 As always, the changes are so general and varied that precise
  434 statements about performance are difficult to make.  Most programs
  435 should run a bit faster, due to better generated code and
  436 optimizations in the core library.
  437 </p>
  438 
  439 <p><!-- CL 74851 -->
  440 There were multiple performance changes to the <code>math/big</code>
  441 package as well as many changes across the tree specific to <code>GOARCH=arm64</code>.
  442 </p>
  443 
  444 <h3 id="performance-compiler">Compiler toolchain</h3>
  445 
  446 <p><!-- CL 110055 -->
  447   The compiler now optimizes map clearing operations of the form:
  448 </p>
  449 <pre>
  450 for k := range m {
  451     delete(m, k)
  452 }
  453 </pre>
  454 
  455 <p><!-- CL 109517 -->
  456   The compiler now optimizes slice extension of the form
  457   <code>append(s,</code>&nbsp;<code>make([]T,</code>&nbsp;<code>n)...)</code>.
  458 </p>
  459 
  460 <p><!-- CL 100277, CL 105635, CL 109776 -->
  461   The compiler now performs significantly more aggressive bounds-check
  462   and branch elimination. Notably, it now recognizes transitive
  463   relations, so if <code>i&lt;j</code> and <code>j&lt;len(s)</code>,
  464   it can use these facts to eliminate the bounds check
  465   for <code>s[i]</code>. It also understands simple arithmetic such
  466   as <code>s[i-10]</code> and can recognize more inductive cases in
  467   loops. Furthermore, the compiler now uses bounds information to more
  468   aggressively optimize shift operations.
  469 </p>
  470 
  471 <h2 id="library">Core library</h2>
  472 
  473 <p>
  474   All of the changes to the standard library are minor.
  475 </p>
  476 
  477 <h3 id="minor_library_changes">Minor changes to the library</h3>
  478 
  479 <p>
  480   As always, there are various minor changes and updates to the library,
  481   made with the Go 1 <a href="/doc/go1compat">promise of compatibility</a>
  482   in mind.
  483 </p>
  484 
  485 <!-- CL 115095: https://golang.org/cl/115095: yes (`go test pkg` now always builds pkg even if there are no test files): cmd/go: output coverage report even if there are no test files -->
  486 <!-- CL 110395: https://golang.org/cl/110395: cmd/go, cmd/compile: use Windows response files to avoid arg length limits -->
  487 <!-- CL 112436: https://golang.org/cl/112436: cmd/pprof: add readline support similar to upstream -->
  488 
  489 
  490 <dl id="crypto"><dt><a href="/pkg/crypto/">crypto</a></dt>
  491   <dd>
  492     <p><!-- CL 64451 -->
  493       Certain crypto operations, including
  494       <a href="/pkg/crypto/ecdsa/#Sign"><code>ecdsa.Sign</code></a>,
  495       <a href="/pkg/crypto/rsa/#EncryptPKCS1v15"><code>rsa.EncryptPKCS1v15</code></a> and
  496       <a href="/pkg/crypto/rsa/#GenerateKey"><code>rsa.GenerateKey</code></a>,
  497       now randomly read an extra byte of randomness to ensure tests don't rely on internal behavior.
  498     </p>
  499 
  500 </dl><!-- crypto -->
  501 
  502 <dl id="crypto/cipher"><dt><a href="/pkg/crypto/cipher/">crypto/cipher</a></dt>
  503   <dd>
  504     <p><!-- CL 48510, CL 116435 -->
  505       The new function <a href="/pkg/crypto/cipher/#NewGCMWithTagSize"><code>NewGCMWithTagSize</code></a>
  506       implements Galois Counter Mode with non-standard tag lengths for compatibility with existing cryptosystems.
  507     </p>
  508 
  509 </dl><!-- crypto/cipher -->
  510 
  511 <dl id="crypto/rsa"><dt><a href="/pkg/crypto/rsa/">crypto/rsa</a></dt>
  512   <dd>
  513     <p><!-- CL 103876 -->
  514       <a href="/pkg/crypto/rsa/#PublicKey"><code>PublicKey</code></a> now implements a
  515       <a href="/pkg/crypto/rsa/#PublicKey.Size"><code>Size</code></a> method that
  516       returns the modulus size in bytes.
  517     </p>
  518 
  519 </dl><!-- crypto/rsa -->
  520 
  521 <dl id="crypto/tls"><dt><a href="/pkg/crypto/tls/">crypto/tls</a></dt>
  522   <dd>
  523     <p><!-- CL 85115 -->
  524       <a href="/pkg/crypto/tls/#ConnectionState"><code>ConnectionState</code></a>'s new
  525       <a href="/pkg/crypto/tls/#ConnectionState.ExportKeyingMaterial"><code>ExportKeyingMaterial</code></a>
  526       method allows exporting keying material bound to the
  527       connection according to RFC 5705.
  528     </p>
  529 
  530 </dl><!-- crypto/tls -->
  531 
  532 <dl id="crypto/x509"><dt><a href="/pkg/crypto/x509/">crypto/x509</a></dt>
  533   <dd>
  534     <p><!-- CL 123355, CL 123695 -->
  535       The deprecated, legacy behavior of treating the <code>CommonName</code> field as
  536       a hostname when no Subject Alternative Names are present is now disabled when the CN is not a
  537       valid hostname.
  538       The <code>CommonName</code> can be completely ignored by adding the experimental value
  539       <code>x509ignoreCN=1</code> to the <code>GODEBUG</code> environment variable.
  540       When the CN is ignored, certificates without SANs validate under chains with name constraints
  541       instead of returning <code>NameConstraintsWithoutSANs</code>.
  542     </p>
  543 
  544     <p><!-- CL 113475 -->
  545       Extended key usage restrictions are again checked only if they appear in the <code>KeyUsages</code>
  546       field of <a href="/pkg/crypto/x509/#VerifyOptions"><code>VerifyOptions</code></a>, instead of always being checked.
  547       This matches the behavior of Go 1.9 and earlier.
  548     </p>
  549 
  550     <p><!-- CL 102699 -->
  551       The value returned by <a href="/pkg/crypto/x509/#SystemCertPool"><code>SystemCertPool</code></a>
  552       is now cached and might not reflect system changes between invocations.
  553     </p>
  554 
  555 </dl><!-- crypto/x509 -->
  556 
  557 <dl id="debug/elf"><dt><a href="/pkg/debug/elf/">debug/elf</a></dt>
  558   <dd>
  559     <p><!-- CL 112115 -->
  560       More <a href="/pkg/debug/elf/#ELFOSABI_NONE"><code>ELFOSABI</code></a>
  561       and <a href="/pkg/debug/elf/#EM_NONE"><code>EM</code></a>
  562       constants have been added.
  563     </p>
  564 
  565 </dl><!-- debug/elf -->
  566 
  567 <dl id="encoding/asn1"><dt><a href="/pkg/encoding/asn1/">encoding/asn1</a></dt>
  568   <dd>
  569     <p><!-- CL 110561 -->
  570       <code>Marshal</code> and <code><a href="/pkg/encoding/asn1/#Unmarshal">Unmarshal</a></code>
  571       now support "private" class annotations for fields.
  572     </p>
  573 
  574 </dl><!-- encoding/asn1 -->
  575 
  576 <dl id="encoding/base32"><dt><a href="/pkg/encoding/base32/">encoding/base32</a></dt>
  577   <dd>
  578     <p><!-- CL 112516 -->
  579       The decoder now consistently
  580       returns <code>io.ErrUnexpectedEOF</code> for an incomplete
  581       chunk. Previously it would return <code>io.EOF</code> in some
  582       cases.
  583     </p>
  584 
  585 </dl><!-- encoding/base32 -->
  586 
  587 <dl id="encoding/csv"><dt><a href="/pkg/encoding/csv/">encoding/csv</a></dt>
  588   <dd>
  589     <p><!-- CL 99696 -->
  590       The <code>Reader</code> now rejects attempts to set
  591       the <a href="/pkg/encoding/csv/#Reader.Comma"><code>Comma</code></a>
  592       field to a double-quote character, as double-quote characters
  593       already have a special meaning in CSV.
  594     </p>
  595 
  596 </dl><!-- encoding/csv -->
  597 
  598 <!-- CL 100235 was reverted -->
  599 
  600 <dl id="html/template"><dt><a href="/pkg/html/template/">html/template</a></dt>
  601   <dd>
  602     <p><!-- CL 121815 -->
  603       The package has changed its behavior when a typed interface
  604       value is passed to an implicit escaper function. Previously such
  605       a value was written out as (an escaped form)
  606       of <code>&lt;nil&gt;</code>. Now such values are ignored, just
  607       as an untyped <code>nil</code> value is (and always has been)
  608       ignored.
  609     </p>
  610 
  611 </dl><!-- html/template -->
  612 
  613 <dl id="image/gif"><dt><a href="/pkg/image/gif/">image/gif</a></dt>
  614   <dd>
  615     <p><!-- CL 93076 -->
  616       Non-looping animated GIFs are now supported. They are denoted by having a
  617       <code><a href="/pkg/image/gif/#GIF.LoopCount">LoopCount</a></code> of -1.
  618     </p>
  619 
  620 </dl><!-- image/gif -->
  621 
  622 <dl id="io/ioutil"><dt><a href="/pkg/io/ioutil/">io/ioutil</a></dt>
  623   <dd>
  624     <p><!-- CL 105675 -->
  625       The <code><a href="/pkg/io/ioutil/#TempFile">TempFile</a></code>
  626       function now supports specifying where the random characters in
  627       the filename are placed. If the <code>prefix</code> argument
  628       includes a "<code>*</code>", the random string replaces the
  629       "<code>*</code>". For example, a <code>prefix</code> argument of "<code>myname.*.bat</code>" will
  630       result in a random filename such as
  631       "<code>myname.123456.bat</code>". If no "<code>*</code>" is
  632       included the old behavior is retained, and the random digits are
  633       appended to the end.
  634     </p>
  635 
  636 </dl><!-- io/ioutil -->
  637 
  638 <dl id="math/big"><dt><a href="/pkg/math/big/">math/big</a></dt>
  639   <dd>
  640 
  641     <p><!-- CL 108996 -->
  642       <a href="/pkg/math/big/#Int.ModInverse"><code>ModInverse</code></a> now returns nil when g and n are not relatively prime. The result was previously undefined.
  643     </p>
  644 
  645 </dl><!-- math/big -->
  646 
  647 <dl id="mime/multipart"><dt><a href="/pkg/mime/multipart/">mime/multipart</a></dt>
  648   <dd>
  649     <p><!-- CL 121055 -->
  650       The handling of form-data with missing/empty file names has been
  651       restored to the behavior in Go 1.9: in the
  652       <a href="/pkg/mime/multipart/#Form"><code>Form</code></a> for
  653       the form-data part the value is available in
  654       the <code>Value</code> field rather than the <code>File</code>
  655       field. In Go releases 1.10 through 1.10.3 a form-data part with
  656       a missing/empty file name and a non-empty "Content-Type" field
  657       was stored in the <code>File</code> field.  This change was a
  658       mistake in 1.10 and has been reverted to the 1.9 behavior.
  659     </p>
  660 
  661 </dl><!-- mime/multipart -->
  662 
  663 <dl id="mime/quotedprintable"><dt><a href="/pkg/mime/quotedprintable/">mime/quotedprintable</a></dt>
  664   <dd>
  665     <p><!-- CL 121095 -->
  666       To support invalid input found in the wild, the package now
  667       permits non-ASCII bytes but does not validate their encoding.
  668     </p>
  669 
  670 </dl><!-- mime/quotedprintable -->
  671 
  672 <dl id="net"><dt><a href="/pkg/net/">net</a></dt>
  673   <dd>
  674     <p><!-- CL 72810 -->
  675       The new <a href="/pkg/net/#ListenConfig"><code>ListenConfig</code></a> type and the new
  676       <a href="/pkg/net/#Dialer.Control"><code>Dialer.Control</code></a> field permit
  677       setting socket options before accepting and creating connections, respectively.
  678     </p>
  679 
  680     <p><!-- CL 76391 -->
  681       The <a href="/pkg/syscall/#RawConn"><code>syscall.RawConn</code></a> <code>Read</code>
  682       and <code>Write</code> methods now work correctly on Windows.
  683     </p>
  684 
  685     <p><!-- CL 107715 -->
  686       The <code>net</code> package now automatically uses the
  687       <a href="http://man7.org/linux/man-pages/man2/splice.2.html"><code>splice</code> system call</a>
  688       on Linux when copying data between TCP connections in
  689       <a href="/pkg/net/#TCPConn.ReadFrom"><code>TCPConn.ReadFrom</code></a>, as called by
  690       <a href="/pkg/io/#Copy"><code>io.Copy</code></a>. The result is faster, more efficient TCP proxying.
  691     </p>
  692 
  693     <p><!-- CL 108297 -->
  694       The <a href="/pkg/net/#TCPConn.File"><code>TCPConn.File</code></a>,
  695       <a href="/pkg/net/#UDPConn.File"><code>UDPConn.File</code></a>,
  696       <a href="/pkg/net/#UnixCOnn.File"><code>UnixConn.File</code></a>,
  697       and <a href="/pkg/net/#IPConn.File"><code>IPConn.File</code></a>
  698       methods no longer put the returned <code>*os.File</code> into
  699       blocking mode.
  700     </p>
  701 
  702 </dl><!-- net -->
  703 
  704 <dl id="net/http"><dt><a href="/pkg/net/http/">net/http</a></dt>
  705   <dd>
  706     <p><!-- CL 71272 -->
  707       The <a href="/pkg/net/http/#Transport"><code>Transport</code></a> type has a
  708       new <a href="/pkg/net/http/#Transport.MaxConnsPerHost"><code>MaxConnsPerHost</code></a>
  709       option that permits limiting the maximum number of connections
  710       per host.
  711     </p>
  712 
  713     <p><!-- CL 79919 -->
  714       The <a href="/pkg/net/http/#Cookie"><code>Cookie</code></a> type has a new
  715       <a href="/pkg/net/http/#Cookie.SameSite"><code>SameSite</code></a> field
  716       (of new type also named
  717       <a href="/pkg/net/http/#SameSite"><code>SameSite</code></a>) to represent the new cookie attribute recently supported by most browsers.
  718       The <code>net/http</code>'s <code>Transport</code> does not use the <code>SameSite</code>
  719       attribute itself, but the package supports parsing and serializing the
  720       attribute for browsers to use.
  721     </p>
  722 
  723     <p><!-- CL 81778 -->
  724       It is no longer allowed to reuse a <a href="/pkg/net/http/#Server"><code>Server</code></a>
  725       after a call to
  726       <a href="/pkg/net/http/#Server.Shutdown"><code>Shutdown</code></a> or
  727       <a href="/pkg/net/http/#Server.Close"><code>Close</code></a>. It was never officially supported
  728       in the past and had often surprising behavior. Now, all future calls to the server's <code>Serve</code>
  729       methods will return errors after a shutdown or close.
  730     </p>
  731 
  732     <!-- CL 89275 was reverted before Go 1.11 -->
  733 
  734     <p><!-- CL 93296 -->
  735       The constant <code>StatusMisdirectedRequest</code> is now defined for HTTP status code 421.
  736     </p>
  737 
  738     <p><!-- CL 123875 -->
  739       The HTTP server will no longer cancel contexts or send on
  740       <a href="/pkg/net/http/#CloseNotifier"><code>CloseNotifier</code></a>
  741       channels upon receiving pipelined HTTP/1.1 requests. Browsers do
  742       not use HTTP pipelining, but some clients (such as
  743       Debian's <code>apt</code>) may be configured to do so.
  744     </p>
  745 
  746     <p><!-- CL 115255 -->
  747       <a href="/pkg/net/http/#ProxyFromEnvironment"><code>ProxyFromEnvironment</code></a>, which is used by the
  748       <a href="/pkg/net/http/#DefaultTransport"><code>DefaultTransport</code></a>, now
  749       supports CIDR notation and ports in the <code>NO_PROXY</code> environment variable.
  750     </p>
  751 
  752 </dl><!-- net/http -->
  753 
  754 <dl id="net/http/httputil"><dt><a href="/pkg/net/http/httputil/">net/http/httputil</a></dt>
  755   <dd>
  756     <p><!-- CL 77410 -->
  757       The
  758       <a href="/pkg/net/http/httputil/#ReverseProxy"><code>ReverseProxy</code></a>
  759       has a new
  760       <a href="/pkg/net/http/httputil/#ReverseProxy.ErrorHandler"><code>ErrorHandler</code></a>
  761       option to permit changing how errors are handled.
  762     </p>
  763 
  764     <p><!-- CL 115135 -->
  765       The <code>ReverseProxy</code> now also passes
  766       "<code>TE:</code>&nbsp;<code>trailers</code>" request headers
  767       through to the backend, as required by the gRPC protocol.
  768     </p>
  769 
  770 </dl><!-- net/http/httputil -->
  771 
  772 <dl id="os"><dt><a href="/pkg/os/">os</a></dt>
  773   <dd>
  774     <p><!-- CL 78835 -->
  775       The new <a href="/pkg/os/#UserCacheDir"><code>UserCacheDir</code></a> function
  776       returns the default root directory to use for user-specific cached data.
  777     </p>
  778 
  779     <p><!-- CL 94856 -->
  780       The new <a href="/pkg/os/#ModeIrregular"><code>ModeIrregular</code></a>
  781       is a <a href="/pkg/os/#FileMode"><code>FileMode</code></a> bit to represent
  782       that a file is not a regular file, but nothing else is known about it, or that
  783       it's not a socket, device, named pipe, symlink, or other file type for which
  784       Go has a defined mode bit.
  785     </p>
  786 
  787     <p><!-- CL 99337 -->
  788       <a href="/pkg/os/#Symlink"><code>Symlink</code></a> now works
  789       for unprivileged users on Windows 10 on machines with Developer
  790       Mode enabled.
  791     </p>
  792 
  793     <p><!-- CL 100077 -->
  794       When a non-blocking descriptor is passed
  795       to <a href="/pkg/os#NewFile"><code>NewFile</code></a>, the
  796       resulting <code>*File</code> will be kept in non-blocking
  797       mode. This means that I/O for that <code>*File</code> will use
  798       the runtime poller rather than a separate thread, and that
  799       the <a href="/pkg/os/#File.SetDeadline"><code>SetDeadline</code></a>
  800       methods will work.
  801     </p>
  802 
  803 </dl><!-- os -->
  804 
  805 <dl id="os/signal"><dt><a href="/pkg/os/signal/">os/signal</a></dt>
  806   <dd>
  807     <p><!-- CL 108376 -->
  808       The new <a href="/pkg/os/signal/#Ignored"><code>Ignored</code></a> function reports
  809       whether a signal is currently ignored.
  810     </p>
  811 
  812 </dl><!-- os/signal -->
  813 
  814 <dl id="os/user"><dt><a href="/pkg/os/user/">os/user</a></dt>
  815   <dd>
  816     <p><!-- CL 92456 -->
  817       The <code>os/user</code> package can now be built in pure Go
  818       mode using the build tag "<code>osusergo</code>",
  819       independent of the use of the environment
  820       variable <code>CGO_ENABLED=0</code>. Previously the only way to use
  821       the package's pure Go implementation was to disable <code>cgo</code>
  822       support across the entire program.
  823     </p>
  824 
  825 </dl><!-- os/user -->
  826 
  827 <!-- CL 101715 was reverted -->
  828 
  829 <dl id="pkg-runtime"><dt id="runtime-again"><a href="/pkg/runtime/">runtime</a></dt>
  830   <dd>
  831 
  832     <p><!-- CL 70993 -->
  833       Setting the <code>GODEBUG=tracebackancestors=<em>N</em></code>
  834       environment variable now extends tracebacks with the stacks at
  835       which goroutines were created, where <em>N</em> limits the
  836       number of ancestor goroutines to report.
  837     </p>
  838 
  839 </dl><!-- runtime -->
  840 
  841 <dl id="runtime/pprof"><dt><a href="/pkg/runtime/pprof/">runtime/pprof</a></dt>
  842   <dd>
  843     <p><!-- CL 102696 -->
  844       This release adds a new "allocs" profile type that profiles
  845       total number of bytes allocated since the program began
  846       (including garbage-collected bytes). This is identical to the
  847       existing "heap" profile viewed in <code>-alloc_space</code> mode.
  848       Now <code>go test -memprofile=...</code> reports an "allocs" profile
  849       instead of "heap" profile.
  850     </p>
  851 
  852 </dl><!-- runtime/pprof -->
  853 
  854 <dl id="sync"><dt><a href="/pkg/sync/">sync</a></dt>
  855   <dd>
  856     <p><!-- CL 87095 -->
  857       The mutex profile now includes reader/writer contention
  858       for <a href="/pkg/sync/#RWMutex"><code>RWMutex</code></a>.
  859       Writer/writer contention was already included in the mutex
  860       profile.
  861     </p>
  862 
  863 </dl><!-- sync -->
  864 
  865 <dl id="syscall"><dt><a href="/pkg/syscall/">syscall</a></dt>
  866   <dd>
  867     <p><!-- CL 106275 -->
  868       On Windows, several fields were changed from <code>uintptr</code> to a new
  869       <a href="/pkg/syscall/?GOOS=windows&GOARCH=amd64#Pointer"><code>Pointer</code></a>
  870       type to avoid problems with Go's garbage collector. The same change was made
  871       to the <a href="https://godoc.org/golang.org/x/sys/windows"><code>golang.org/x/sys/windows</code></a>
  872       package. For any code affected, users should first migrate away from the <code>syscall</code>
  873       package to the <code>golang.org/x/sys/windows</code> package, and then change
  874       to using the <code>Pointer</code>, while obeying the
  875       <a href="/pkg/unsafe/#Pointer"><code>unsafe.Pointer</code> conversion rules</a>.
  876     </p>
  877 
  878     <p><!-- CL 118658 -->
  879       On Linux, the <code>flags</code> parameter to
  880       <a href="/pkg/syscall/?GOOS=linux&GOARCH=amd64#Faccessat"><code>Faccessat</code></a>
  881       is now implemented just as in glibc. In earlier Go releases the
  882       flags parameter was ignored.
  883     </p>
  884 
  885     <p><!-- CL 118658 -->
  886       On Linux, the <code>flags</code> parameter to
  887       <a href="/pkg/syscall/?GOOS=linux&GOARCH=amd64#Fchmodat"><code>Fchmodat</code></a>
  888       is now validated. Linux's <code>fchmodat</code> doesn't support the <code>flags</code> parameter
  889       so we now mimic glibc's behavior and return an error if it's non-zero.
  890     </p>
  891 
  892 </dl><!-- syscall -->
  893 
  894 <dl id="text/scanner"><dt><a href="/pkg/text/scanner/">text/scanner</a></dt>
  895   <dd>
  896     <p><!-- CL 112037 -->
  897       The <a href="/pkg/text/scanner/#Scanner.Scan"><code>Scanner.Scan</code></a> method now returns
  898       the <a href="/pkg/text/scanner/#RawString"><code>RawString</code></a> token
  899       instead of <a href="/pkg/text/scanner/#String"><code>String</code></a>
  900       for raw string literals.
  901     </p>
  902 
  903 </dl><!-- text/scanner -->
  904 
  905 <dl id="text/template"><dt><a href="/pkg/text/template/">text/template</a></dt>
  906   <dd>
  907     <p><!-- CL 84480 -->
  908       Modifying template variables via assignments is now permitted via the <code>=</code> token:
  909     </p>
  910     <pre>
  911   {{"{{"}} $v := "init" {{"}}"}}
  912   {{"{{"}} if true {{"}}"}}
  913     {{"{{"}} $v = "changed" {{"}}"}}
  914   {{"{{"}} end {{"}}"}}
  915   v: {{"{{"}} $v {{"}}"}} {{"{{"}}/* "changed" */{{"}}"}}</pre>
  916 
  917     <p><!-- CL 95215 -->
  918       In previous versions untyped <code>nil</code> values passed to
  919       template functions were ignored. They are now passed as normal
  920       arguments.
  921     </p>
  922 
  923 </dl><!-- text/template -->
  924 
  925 <dl id="time"><dt><a href="/pkg/time/">time</a></dt>
  926   <dd>
  927     <p><!-- CL 98157 -->
  928       Parsing of timezones denoted by sign and offset is now
  929       supported. In previous versions, numeric timezone names
  930       (such as <code>+03</code>) were not considered valid, and only
  931       three-letter abbreviations (such as <code>MST</code>) were accepted
  932       when expecting a timezone name.
  933     </p>
  934 </dl><!-- time -->