]> Cypherpunks.ru repositories - gostls13.git/blob - doc/go1.15.html
time/tzdata: new package
[gostls13.git] / doc / go1.15.html
1 <!--{
2         "Title": "Go 1.15 Release Notes",
3         "Path":  "/doc/go1.15"
4 }-->
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
13 <style>
14   main ul li { margin: 0.5em 0; }
15 </style>
16
17 <h2 id="introduction">DRAFT RELEASE NOTES — Introduction to Go 1.15</h2>
18
19 <p>
20   <strong>
21     Go 1.15 is not yet released. These are work-in-progress
22     release notes. Go 1.15 is expected to be released in August 2020.
23   </strong>
24 </p>
25
26 <h2 id="language">Changes to the language</h2>
27
28 <p>
29 TODO
30 </p>
31
32 <h2 id="ports">Ports</h2>
33
34 <p>
35 TODO
36 </p>
37
38 <h2 id="tools">Tools</h2>
39
40 <p>
41 TODO
42 </p>
43
44 <h3 id="go-command">Go command</h3>
45
46 <p><!-- golang.org/issue/37367 -->
47   The <code>GOPROXY</code> environment variable now supports skipping proxies
48   that return errors. Proxy URLs may now be separated with either commas
49   (<code>,</code>) or pipe characters (<code>|</code>). If a proxy URL is
50   followed by a comma, the <code>go</code> command will only try the next proxy
51   in the list after a 404 or 410 HTTP response. If a proxy URL is followed by a
52   pipe character, the <code>go</code> command will try the next proxy in the
53   list after any error. Note that the default value of <code>GOPROXY</code>
54   remains <code>https://proxy.golang.org,direct</code>, which does not fall
55   back to <code>direct</code> in case of errors.
56 </p>
57
58 <p>
59 TODO
60 </p>
61
62 <h4 id="go-test"><code>go</code> <code>test</code></h4>
63
64 <p><!-- https://golang.org/issue/36134 -->
65   Changing the <code>-timeout</code> flag now invalidates cached test results. A
66   cached result for a test run with a long timeout will no longer count as
67   passing when <code>go</code> <code>test</code> is re-invoked with a short one.
68 </p>
69
70 <h4 id="go-flag-parsing">Flag parsing</h4>
71
72 <p><!-- https://golang.org/cl/211358 -->
73   Various flag parsing issues in <code>go</code> <code>test</code> and
74   <code>go</code> <code>vet</code> have been fixed. Notably, flags specified
75   in <code>GOFLAGS</code> are handled more consistently, and
76   the <code>-outputdir</code> flag now interprets relative paths relative to the
77   working directory of the <code>go</code> command (rather than the working
78   directory of each individual test).
79 </p>
80
81 <h2 id="runtime">Runtime</h2>
82
83 <p>
84 TODO
85 </p>
86
87
88 <h2 id="library">Core library</h2>
89
90 <h3 id="time/tzdata">New embedded tzdata package</h3>
91
92 <p> <!-- CL 224588 -->
93   Go 1.15 includes a new package,
94   <a href="/pkg/time/tzdata/"><code>time/tzdata</code></a>,
95   that permits embedding the timezone database into a program.
96   Importing this package (as <code>import _ "time/tzdata"</code>)
97   permits the program to find timezone information even if the
98   timezone database is not available on the local system.
99   You can also embed the timezone database by building
100   with <code>-tags timetzdata</code>.
101   Either approach increases the size of the program by about 800K.
102 </p>
103
104 <p>
105 TODO
106 </p>
107
108 <dl id="testing"><dt><a href="/pkg/testing/">testing</a></dt>
109   <dd>
110     <p><!-- golang.org/issue/28135 -->
111       The <code>testing.T</code> type now has a <code>Deadline</code> method
112       that reports the time at which the test binary will have exceeded its
113       timeout.
114     </p>
115     <p><!-- golang.org/issue/34129 -->
116       A <code>TestMain</code> function is no longer required to call
117       <code>os.Exit</code>. If a <code>TestMain</code> function returns,
118       the test binary will call <code>os.Exit</code> with the value returned
119       by <code>m.Run</code>.
120     </p>
121   </dd>
122 </dl><!-- testing -->
123
124 <h3 id="minor_library_changes">Minor changes to the library</h3>
125
126 <p>
127   As always, there are various minor changes and updates to the library,
128   made with the Go 1 <a href="/doc/go1compat">promise of compatibility</a>
129   in mind.
130 </p>
131
132 <p>
133 TODO
134 </p>
135
136 <dl id="flag"><dt><a href="/pkg/flag/">flag</a></dt>
137   <dd>
138     <p><!-- CL 221427 -->
139       When the flag package sees <code>-h</code> or <code>-help</code>, and
140       those flags are not defined, the flag package prints a usage message.
141       If the <a href=/pkg/flag/#FlagSet><code>FlagSet</code></a> was created with
142       <a href=/pkg/flag/#ExitOnError><code>ExitOnError</code></a>,
143       <a href=/pkg/flag/#FlagSet.Parse><code>FlagSet.Parse</code></a> would then
144       exit with a status of 2. In this release, the exit status for <code>-h</code>
145       or <code>-help</code> has been changed to 0. In particular, this applies to
146       the default handling of command line flags.
147     </p>
148   </dd>
149 </dl>
150
151 <dl id="net/url"><dt><a href="/pkg/net/url/">net/url</a></dt>
152   <dd>
153     <p><!-- CL 207082 -->
154       The new <a href="/pkg/net/url/#URL"><code>URL</code></a>
155       method <a href="/pkg/net/url/#URL.Redacted"><code>Redacted</code></a>
156       returns the URL in string form with any password replaced with <code>xxxxx</code>.
157     </p>
158   </dd>
159 </dl>
160
161 <dl id="pkg-runtime"><dt><a href="/pkg/runtime/">runtime</a></dt>
162   <dd>
163     <p><!-- CL 221779 -->
164       If <code>panic</code> is invoked with a value whose type is derived from any
165       of: <code>bool</code>, <code>complex64</code>, <code>complex128</code>, <code>float32</code>, <code>float64</code>,
166       <code>int</code>, <code>int8</code>, <code>int16</code>, <code>int32</code>, <code>int64</code>, <code>string</code>,
167       <code>uint</code>, <code>uint8</code>, <code>uint16</code>, <code>uint32</code>, <code>uint64</code>, <code>uintptr</code>,
168       then the value will be printed, instead of just its address.
169     </p>
170   </dd>
171 </dl>
172
173 <dl id="sync"><dt><a href="/pkg/sync/">sync</a></dt>
174   <dd>
175     <p><!-- CL 205899, golang.org/issue/33762 -->
176       The new method
177       <a href="/pkg/sync/#Map.LoadAndDelete"><code>Map.LoadAndDelete</code></a>
178       atomically deletes a key and returns the previous value if present.
179     </p>
180     <p><!-- CL 205899 -->
181       The method
182       <a href="/pkg/sync/#Map.Delete"><code>Map.Delete</code></a>
183       is more efficient.
184     </p>
185 </dl><!-- sync -->
186
187 <dl id="testing"><dt><a href="/pkg/testing/">testing</a></dt>
188   <dd>
189     <p><!-- CL 226877, golang.org/issue/35998 -->
190        The new methods
191        <a href="/pkg/testing/#T.TempDir"><code>T.TempDir</code></a> and
192        <a href="/pkg/testing/#B.TempDir"><code>B.TempDir</code></a> and
193        return temporary directories that are automatically cleaned up
194        at the end of the test.
195     </p>
196   </dd>
197 </dl><!-- testing -->
198
199 <dl id="time"><dt><a href="/pkg/time/">time</a></dt>
200   <dd>
201     <p><!-- CL 220424, CL 217362, golang.org/issue/33184 -->
202        The new method
203        <a href="/pkg/time/#Ticker.Reset"><code>Ticker.Reset</code></a>
204        supports changing the duration of a ticker.
205     </p>
206   </dd>
207 </dl><!-- time -->