go1.19.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <!--{
  2. "Title": "Go 1.19 Release Notes",
  3. "Path": "/doc/go1.19"
  4. }-->
  5. <!--
  6. NOTE: In this document and others in this directory, the convention is to
  7. set fixed-width phrases with non-fixed-width spaces, as in
  8. <code>hello</code> <code>world</code>.
  9. Do not send CLs removing the interior tags from such phrases.
  10. -->
  11. <style>
  12. main ul li { margin: 0.5em 0; }
  13. </style>
  14. <h2 id="introduction">DRAFT RELEASE NOTES — Introduction to Go 1.19</h2>
  15. <p>
  16. <strong>
  17. Go 1.19 is not yet released. These are work-in-progress
  18. release notes. Go 1.19 is expected to be released in August 2022.
  19. </strong>
  20. </p>
  21. <h2 id="language">Changes to the language</h2>
  22. <p>
  23. TODO: complete this section
  24. </p>
  25. <h2 id="ports">Ports</h2>
  26. <p>
  27. TODO: complete this section, or delete if not needed
  28. </p>
  29. <h2 id="tools">Tools</h2>
  30. <p>
  31. TODO: complete this section, or delete if not needed
  32. </p>
  33. <h3 id="go-command">Go command</h3>
  34. <p>
  35. TODO: complete this section.
  36. </p>
  37. <!-- https://go.dev/issue/51461 -->
  38. <p>
  39. The <code>-trimpath</code> flag, if set, is now included in the build settings
  40. stamped into Go binaries by <code>go</code> <code>build</code>, and can be
  41. examined using
  42. <a href="https://pkg.go.dev/cmd/go#hdr-Print_Go_version"><code>go</code> <code>version</code> <code>-m</code></a>
  43. or <a href="https://pkg.go.dev/runtime/debug#ReadBuildInfo"><code>debug.ReadBuildInfo</code></a>.
  44. </p>
  45. <p>
  46. <code>go</code> <code>generate</code> now sets the <code>GOROOT</code>
  47. environment variable explicitly in the generator's environment, so that
  48. generators can locate the correct <code>GOROOT</code> even if built
  49. with <code>-trimpath</code>.
  50. </p>
  51. <h4 id="go-unix">New <code>unix</code> build constraint</h4>
  52. <p><!-- CL 389934 -->
  53. The build constraint <code>unix</code> is now recognized
  54. in <code>//go:build</code> lines. The constraint is satisfied
  55. if the target operating system, also known as <code>GOOS</code>, is
  56. a Unix or Unix-like system. For the 1.19 release it is satisfied
  57. if <code>GOOS</code> is one of
  58. <code>aix</code>, <code>android</code>, <code>darwin</code>,
  59. <code>dragonfly</code>, <code>freebsd</code>, <code>hurd</code>,
  60. <code>illumos</code>, <code>ios</code>, <code>linux</code>,
  61. <code>netbsd</code>, <code>openbsd</code>, or <code>solaris</code>.
  62. In future releases the <code>unix</code> constraint may match
  63. additional newly supported operating systems.
  64. </p>
  65. <h2 id="runtime">Runtime</h2>
  66. <p>
  67. TODO: complete this section, or delete if not needed
  68. </p>
  69. <h2 id="compiler">Compiler</h2>
  70. <p>
  71. TODO: complete this section, or delete if not needed
  72. </p>
  73. <h2 id="linker">Linker</h2>
  74. <p>
  75. TODO: complete this section, or delete if not needed
  76. </p>
  77. <h2 id="library">Core library</h2>
  78. <p>
  79. TODO: complete this section
  80. </p>
  81. <h3 id="minor_library_changes">Minor changes to the library</h3>
  82. <p>
  83. As always, there are various minor changes and updates to the library,
  84. made with the Go 1 <a href="/doc/go1compat">promise of compatibility</a>
  85. in mind.
  86. </p>
  87. <p>
  88. TODO: complete this section
  89. </p>
  90. <dl id="crypto/tls"><dt><a href="/pkg/crypto/tls/">crypto/tls</a></dt>
  91. <dd>
  92. <p><!-- CL 400974 -->
  93. The <code>tls10default</code> <code>GODEBUG</code> option has been
  94. removed. It is still possible to enable TLS 1.0 client-side by setting
  95. <code>Config.MinVersion</code>.
  96. </p>
  97. </dd>
  98. </dl><!-- crypto/tls -->
  99. <dl id="image/draw"><dt><a href="/pkg/image/draw/">image/draw</a></dt>
  100. <dd>
  101. <p><!-- CL 396795 -->
  102. <code>Draw</code> with the <code>Src</code> operator preserves
  103. non-premultiplied-alpha colors when destination and source images are
  104. both <code>*image.NRGBA</code> (or both <code>*image.NRGBA64</code>).
  105. This reverts a behavior change accidentally introduced by a Go 1.18
  106. library optimization, to match the behavior in Go 1.17 and earlier.
  107. </p>
  108. </dd>
  109. </dl><!-- image/draw -->
  110. <dl id="net"><dt><a href="/pkg/net/">net</a></dt>
  111. <dd>
  112. <p><!-- CL 386016 -->
  113. The pure Go resolver will now use EDNS(0) to include a suggested
  114. maximum reply packet length, permitting reply packets to contain
  115. up to 1232 bytes (the previous maximum was 512).
  116. In the unlikely event that this causes problems with a local DNS
  117. resolver, setting the environment variable
  118. <code>GODEBUG=netdns=cgo</code> to use the cgo-based resolver
  119. should work.
  120. Please report any such problems on <a href="/issue/new">the
  121. issue tracker</a>.
  122. </p>
  123. <p><!-- CL 396877 -->
  124. When a net package function or method returns an "I/O timeout"
  125. error, the error will now satisfy <code>errors.Is(err,
  126. context.DeadlineExceeded)</code>. When a net package function
  127. returns an "operation was canceled" error, the error will now
  128. satisfy <code>errors.Is(err, context.Canceled)</code>.
  129. These changes are intended to make it easier for code to test
  130. for cases in which a context cancelation or timeout causes a net
  131. package function or method to return an error, while preserving
  132. backward compatibility for error messages.
  133. </p>
  134. </dd>
  135. </dl><!-- net -->
  136. <dl id="os/exec"><dt><a href="/pkg/os/exec/">os/exec</a></dt>
  137. <dd><!-- https://go.dev/issue/50599 -->
  138. <p>
  139. An <code>exec.Cmd</code> with a non-empty <code>Dir</code> and a
  140. nil <code>Env</code> now implicitly sets the <code>PWD</code> environment
  141. variable for the subprocess to match <code>Dir</code>.
  142. </p>
  143. <p>
  144. The new method <code>(*exec.Cmd).Environ</code> reports the
  145. environment that would be used to run the command, including the
  146. aforementioned <code>PWD</code> variable.
  147. </p>
  148. </dd>
  149. </dl> <!-- os/exec -->
  150. <dl id="runtime"><dt><a href="/pkg/runtime/">runtime</a></dt>
  151. <dd>
  152. <p><!-- https://go.dev/issue/51461 -->
  153. The <code>GOROOT</code> function now returns the empty string
  154. (instead of <code>"go"</code>) when the binary was built with
  155. the <code>-trimpath</code> flag set and the <code>GOROOT</code>
  156. variable is not set in the process environment.
  157. </p>
  158. </dd>
  159. </dl><!-- runtime -->
  160. <dl id="strconv"><dt><a href="/pkg/strconv/">strconv</a></dt>
  161. <dd>
  162. <p><!-- CL 397255 -->
  163. <a href="/pkg/strconv/#strconv.Quote"><code>strconv.Quote</code></a>
  164. and related functions now quote the rune 007F as <code>\x7f</code>,
  165. not <code>\u007f</code>.
  166. </p>
  167. </dd>
  168. </dl><!-- strconv -->