go1.3.html 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. <!--{
  2. "Title": "Go 1.3 Release Notes",
  3. "Path": "/doc/go1.3",
  4. "Template": true
  5. }-->
  6. <h2 id="introduction">Introduction to Go 1.3</h2>
  7. <p>
  8. The latest Go release, version 1.3, arrives six months after 1.2,
  9. and contains no language changes.
  10. It focuses primarily on implementation work, providing
  11. precise garbage collection,
  12. a major refactoring of the compiler tool chain that results in
  13. faster builds, especially for large projects,
  14. significant performance improvements across the board,
  15. and support for DragonFly BSD, Solaris, Plan 9 and Google's Native Client architecture (NaCl).
  16. It also has an important refinement to the memory model regarding synchronization.
  17. As always, Go 1.3 keeps the <a href="/doc/go1compat.html">promise
  18. of compatibility</a>,
  19. and almost everything
  20. will continue to compile and run without change when moved to 1.3.
  21. </p>
  22. <h2 id="os">Changes to the supported operating systems and architectures</h2>
  23. <h3 id="win2000">Removal of support for Windows 2000</h3>
  24. <p>
  25. Microsoft stopped supporting Windows 2000 in 2010.
  26. Since it has <a href="https://codereview.appspot.com/74790043">implementation difficulties</a>
  27. regarding exception handling (signals in Unix terminology),
  28. as of Go 1.3 it is not supported by Go either.
  29. </p>
  30. <h3 id="dragonfly">Support for DragonFly BSD</h3>
  31. <p>
  32. Go 1.3 now includes experimental support for DragonFly BSD on the <code>amd64</code> (64-bit x86) and <code>386</code> (32-bit x86) architectures.
  33. It uses DragonFly BSD 3.6 or above.
  34. </p>
  35. <h3 id="freebsd">Support for FreeBSD</h3>
  36. <p>
  37. It was not announced at the time, but since the release of Go 1.2, support for Go on FreeBSD
  38. requires FreeBSD 8 or above.
  39. </p>
  40. <p>
  41. As of Go 1.3, support for Go on FreeBSD requires that the kernel be compiled with the
  42. <code>COMPAT_FREEBSD32</code> flag configured.
  43. </p>
  44. <p>
  45. In concert with the switch to EABI syscalls for ARM platforms, Go 1.3 will run only on FreeBSD 10.
  46. The x86 platforms, 386 and amd64, are unaffected.
  47. </p>
  48. <h3 id="nacl">Support for Native Client</h3>
  49. <p>
  50. Support for the Native Client virtual machine architecture has returned to Go with the 1.3 release.
  51. It runs on the 32-bit Intel architectures (<code>GOARCH=386</code>) and also on 64-bit Intel, but using
  52. 32-bit pointers (<code>GOARCH=amd64p32</code>).
  53. There is not yet support for Native Client on ARM.
  54. Note that this is Native Client (NaCl), not Portable Native Client (PNaCl).
  55. Details about Native Client are <a href="https://developers.google.com/native-client/dev/">here</a>;
  56. how to set up the Go version is described <a href="//golang.org/wiki/NativeClient">here</a>.
  57. </p>
  58. <h3 id="netbsd">Support for NetBSD</h3>
  59. <p>
  60. As of Go 1.3, support for Go on NetBSD requires NetBSD 6.0 or above.
  61. </p>
  62. <h3 id="openbsd">Support for OpenBSD</h3>
  63. <p>
  64. As of Go 1.3, support for Go on OpenBSD requires OpenBSD 5.5 or above.
  65. </p>
  66. <h3 id="plan9">Support for Plan 9</h3>
  67. <p>
  68. Go 1.3 now includes experimental support for Plan 9 on the <code>386</code> (32-bit x86) architecture.
  69. It requires the <code>Tsemacquire</code> syscall, which has been in Plan 9 since June, 2012.
  70. </p>
  71. <h3 id="solaris">Support for Solaris</h3>
  72. <p>
  73. Go 1.3 now includes experimental support for Solaris on the <code>amd64</code> (64-bit x86) architecture.
  74. It requires illumos, Solaris 11 or above.
  75. </p>
  76. <h2 id="memory">Changes to the memory model</h2>
  77. <p>
  78. The Go 1.3 memory model <a href="https://codereview.appspot.com/75130045">adds a new rule</a>
  79. concerning sending and receiving on buffered channels,
  80. to make explicit that a buffered channel can be used as a simple
  81. semaphore, using a send into the
  82. channel to acquire and a receive from the channel to release.
  83. This is not a language change, just a clarification about an expected property of communication.
  84. </p>
  85. <h2 id="impl">Changes to the implementations and tools</h2>
  86. <h3 id="stacks">Stack</h3>
  87. <p>
  88. Go 1.3 has changed the implementation of goroutine stacks away from the old,
  89. "segmented" model to a contiguous model.
  90. When a goroutine needs more stack
  91. than is available, its stack is transferred to a larger single block of memory.
  92. The overhead of this transfer operation amortizes well and eliminates the old "hot spot"
  93. problem when a calculation repeatedly steps across a segment boundary.
  94. Details including performance numbers are in this
  95. <a href="//golang.org/s/contigstacks">design document</a>.
  96. </p>
  97. <h3 id="garbage_collector">Changes to the garbage collector</h3>
  98. <p>
  99. For a while now, the garbage collector has been <em>precise</em> when examining
  100. values in the heap; the Go 1.3 release adds equivalent precision to values on the stack.
  101. This means that a non-pointer Go value such as an integer will never be mistaken for a
  102. pointer and prevent unused memory from being reclaimed.
  103. </p>
  104. <p>
  105. Starting with Go 1.3, the runtime assumes that values with pointer type
  106. contain pointers and other values do not.
  107. This assumption is fundamental to the precise behavior of both stack expansion
  108. and garbage collection.
  109. Programs that use <a href="/pkg/unsafe/">package unsafe</a>
  110. to store integers in pointer-typed values are illegal and will crash if the runtime detects the behavior.
  111. Programs that use <a href="/pkg/unsafe/">package unsafe</a> to store pointers
  112. in integer-typed values are also illegal but more difficult to diagnose during execution.
  113. Because the pointers are hidden from the runtime, a stack expansion or garbage collection
  114. may reclaim the memory they point at, creating
  115. <a href="//en.wikipedia.org/wiki/Dangling_pointer">dangling pointers</a>.
  116. </p>
  117. <p>
  118. <em>Updating</em>: Code that uses <code>unsafe.Pointer</code> to convert
  119. an integer-typed value held in memory into a pointer is illegal and must be rewritten.
  120. Such code can be identified by <code>go vet</code>.
  121. </p>
  122. <h3 id="map">Map iteration</h3>
  123. <p>
  124. Iterations over small maps no longer happen in a consistent order.
  125. Go 1 defines that &ldquo;<a href="//golang.org/ref/spec#For_statements">The iteration order over maps
  126. is not specified and is not guaranteed to be the same from one iteration to the next.</a>&rdquo;
  127. To keep code from depending on map iteration order,
  128. Go 1.0 started each map iteration at a random index in the map.
  129. A new map implementation introduced in Go 1.1 neglected to randomize
  130. iteration for maps with eight or fewer entries, although the iteration order
  131. can still vary from system to system.
  132. This has allowed people to write Go 1.1 and Go 1.2 programs that
  133. depend on small map iteration order and therefore only work reliably on certain systems.
  134. Go 1.3 reintroduces random iteration for small maps in order to flush out these bugs.
  135. </p>
  136. <p>
  137. <em>Updating</em>: If code assumes a fixed iteration order for small maps,
  138. it will break and must be rewritten not to make that assumption.
  139. Because only small maps are affected, the problem arises most often in tests.
  140. </p>
  141. <h3 id="liblink">The linker</h3>
  142. <p>
  143. As part of the general <a href="//golang.org/s/go13linker">overhaul</a> to
  144. the Go linker, the compilers and linkers have been refactored.
  145. The linker is still a C program, but now the instruction selection phase that
  146. was part of the linker has been moved to the compiler through the creation of a new
  147. library called <code>liblink</code>.
  148. By doing instruction selection only once, when the package is first compiled,
  149. this can speed up compilation of large projects significantly.
  150. </p>
  151. <p>
  152. <em>Updating</em>: Although this is a major internal change, it should have no
  153. effect on programs.
  154. </p>
  155. <h3 id="gccgo">Status of gccgo</h3>
  156. <p>
  157. GCC release 4.9 will contain the Go 1.2 (not 1.3) version of gccgo.
  158. The release schedules for the GCC and Go projects do not coincide,
  159. which means that 1.3 will be available in the development branch but
  160. that the next GCC release, 4.10, will likely have the Go 1.4 version of gccgo.
  161. </p>
  162. <h3 id="gocmd">Changes to the go command</h3>
  163. <p>
  164. The <a href="/cmd/go/"><code>cmd/go</code></a> command has several new
  165. features.
  166. The <a href="/cmd/go/"><code>go run</code></a> and
  167. <a href="/cmd/go/"><code>go test</code></a> subcommands
  168. support a new <code>-exec</code> option to specify an alternate
  169. way to run the resulting binary.
  170. Its immediate purpose is to support NaCl.
  171. </p>
  172. <p>
  173. The test coverage support of the <a href="/cmd/go/"><code>go test</code></a>
  174. subcommand now automatically sets the coverage mode to <code>-atomic</code>
  175. when the race detector is enabled, to eliminate false reports about unsafe
  176. access to coverage counters.
  177. </p>
  178. <p>
  179. The <a href="/cmd/go/"><code>go test</code></a> subcommand
  180. now always builds the package, even if it has no test files.
  181. Previously, it would do nothing if no test files were present.
  182. </p>
  183. <p>
  184. The <a href="/cmd/go/"><code>go build</code></a> subcommand
  185. supports a new <code>-i</code> option to install dependencies
  186. of the specified target, but not the target itself.
  187. </p>
  188. <p>
  189. Cross compiling with <a href="/cmd/cgo/"><code>cgo</code></a> enabled
  190. is now supported.
  191. The CC_FOR_TARGET and CXX_FOR_TARGET environment
  192. variables are used when running all.bash to specify the cross compilers
  193. for C and C++ code, respectively.
  194. </p>
  195. <p>
  196. Finally, the go command now supports packages that import Objective-C
  197. files (suffixed <code>.m</code>) through cgo.
  198. </p>
  199. <h3 id="cgo">Changes to cgo</h3>
  200. <p>
  201. The <a href="/cmd/cgo/"><code>cmd/cgo</code></a> command,
  202. which processes <code>import "C"</code> declarations in Go packages,
  203. has corrected a serious bug that may cause some packages to stop compiling.
  204. Previously, all pointers to incomplete struct types translated to the Go type <code>*[0]byte</code>,
  205. with the effect that the Go compiler could not diagnose passing one kind of struct pointer
  206. to a function expecting another.
  207. Go 1.3 corrects this mistake by translating each different
  208. incomplete struct to a different named type.
  209. </p>
  210. <p>
  211. Given the C declaration <code>typedef struct S T</code> for an incomplete <code>struct S</code>,
  212. some Go code used this bug to refer to the types <code>C.struct_S</code> and <code>C.T</code> interchangeably.
  213. Cgo now explicitly allows this use, even for completed struct types.
  214. However, some Go code also used this bug to pass (for example) a <code>*C.FILE</code>
  215. from one package to another.
  216. This is not legal and no longer works: in general Go packages
  217. should avoid exposing C types and names in their APIs.
  218. </p>
  219. <p>
  220. <em>Updating</em>: Code confusing pointers to incomplete types or
  221. passing them across package boundaries will no longer compile
  222. and must be rewritten.
  223. If the conversion is correct and must be preserved,
  224. use an explicit conversion via <a href="/pkg/unsafe/#Pointer"><code>unsafe.Pointer</code></a>.
  225. </p>
  226. <h3 id="swig">SWIG 3.0 required for programs that use SWIG</h3>
  227. <p>
  228. For Go programs that use SWIG, SWIG version 3.0 is now required.
  229. The <a href="/cmd/go"><code>cmd/go</code></a> command will now link the
  230. SWIG generated object files directly into the binary, rather than
  231. building and linking with a shared library.
  232. </p>
  233. <h3 id="gc_flag">Command-line flag parsing</h3>
  234. <p>
  235. In the gc tool chain, the assemblers now use the
  236. same command-line flag parsing rules as the Go flag package, a departure
  237. from the traditional Unix flag parsing.
  238. This may affect scripts that invoke the tool directly.
  239. For example,
  240. <code>go tool 6a -SDfoo</code> must now be written
  241. <code>go tool 6a -S -D foo</code>.
  242. (The same change was made to the compilers and linkers in <a href="/doc/go1.1#gc_flag">Go 1.1</a>.)
  243. </p>
  244. <h3 id="godoc">Changes to godoc</h3>
  245. <p>
  246. When invoked with the <code>-analysis</code> flag,
  247. <a href="//godoc.org/golang.org/x/tools/cmd/godoc">godoc</a>
  248. now performs sophisticated <a href="/lib/godoc/analysis/help.html">static
  249. analysis</a> of the code it indexes.
  250. The results of analysis are presented in both the source view and the
  251. package documentation view, and include the call graph of each package
  252. and the relationships between
  253. definitions and references,
  254. types and their methods,
  255. interfaces and their implementations,
  256. send and receive operations on channels,
  257. functions and their callers, and
  258. call sites and their callees.
  259. </p>
  260. <h3 id="misc">Miscellany</h3>
  261. <p>
  262. The program <code>misc/benchcmp</code> that compares
  263. performance across benchmarking runs has been rewritten.
  264. Once a shell and awk script in the main repository, it is now a Go program in the <code>go.tools</code> repo.
  265. Documentation is <a href="//godoc.org/golang.org/x/tools/cmd/benchcmp">here</a>.
  266. </p>
  267. <p>
  268. For the few of us that build Go distributions, the tool <code>misc/dist</code> has been
  269. moved and renamed; it now lives in <code>misc/makerelease</code>, still in the main repository.
  270. </p>
  271. <h2 id="performance">Performance</h2>
  272. <p>
  273. The performance of Go binaries for this release has improved in many cases due to changes
  274. in the runtime and garbage collection, plus some changes to libraries.
  275. Significant instances include:
  276. </p>
  277. <ul>
  278. <li>
  279. The runtime handles defers more efficiently, reducing the memory footprint by about two kilobytes
  280. per goroutine that calls defer.
  281. </li>
  282. <li>
  283. The garbage collector has been sped up, using a concurrent sweep algorithm,
  284. better parallelization, and larger pages.
  285. The cumulative effect can be a 50-70% reduction in collector pause time.
  286. </li>
  287. <li>
  288. The race detector (see <a href="/doc/articles/race_detector.html">this guide</a>)
  289. is now about 40% faster.
  290. </li>
  291. <li>
  292. The regular expression package <a href="/pkg/regexp/"><code>regexp</code></a>
  293. is now significantly faster for certain simple expressions due to the implementation of
  294. a second, one-pass execution engine.
  295. The choice of which engine to use is automatic;
  296. the details are hidden from the user.
  297. </li>
  298. </ul>
  299. <p>
  300. Also, the runtime now includes in stack dumps how long a goroutine has been blocked,
  301. which can be useful information when debugging deadlocks or performance issues.
  302. </p>
  303. <h2 id="library">Changes to the standard library</h2>
  304. <h3 id="new_packages">New packages</h3>
  305. <p>
  306. A new package <a href="/pkg/debug/plan9obj/"><code>debug/plan9obj</code></a> was added to the standard library.
  307. It implements access to Plan 9 <a href="http://plan9.bell-labs.com/magic/man2html/6/a.out">a.out</a> object files.
  308. </p>
  309. <h3 id="major_library_changes">Major changes to the library</h3>
  310. <p>
  311. A previous bug in <a href="/pkg/crypto/tls/"><code>crypto/tls</code></a>
  312. made it possible to skip verification in TLS inadvertently.
  313. In Go 1.3, the bug is fixed: one must specify either ServerName or
  314. InsecureSkipVerify, and if ServerName is specified it is enforced.
  315. This may break existing code that incorrectly depended on insecure
  316. behavior.
  317. </p>
  318. <p>
  319. There is an important new type added to the standard library: <a href="/pkg/sync/#Pool"><code>sync.Pool</code></a>.
  320. It provides an efficient mechanism for implementing certain types of caches whose memory
  321. can be reclaimed automatically by the system.
  322. </p>
  323. <p>
  324. The <a href="/pkg/testing/"><code>testing</code></a> package's benchmarking helper,
  325. <a href="/pkg/testing/#B"><code>B</code></a>, now has a
  326. <a href="/pkg/testing/#B.RunParallel"><code>RunParallel</code></a> method
  327. to make it easier to run benchmarks that exercise multiple CPUs.
  328. </p>
  329. <p>
  330. <em>Updating</em>: The crypto/tls fix may break existing code, but such
  331. code was erroneous and should be updated.
  332. </p>
  333. <h3 id="minor_library_changes">Minor changes to the library</h3>
  334. <p>
  335. The following list summarizes a number of minor changes to the library, mostly additions.
  336. See the relevant package documentation for more information about each change.
  337. </p>
  338. <ul>
  339. <li> In the <a href="/pkg/crypto/tls/"><code>crypto/tls</code></a> package,
  340. a new <a href="/pkg/crypto/tls/#DialWithDialer"><code>DialWithDialer</code></a>
  341. function lets one establish a TLS connection using an existing dialer, making it easier
  342. to control dial options such as timeouts.
  343. The package also now reports the TLS version used by the connection in the
  344. <a href="/pkg/crypto/tls/#ConnectionState"><code>ConnectionState</code></a>
  345. struct.
  346. </li>
  347. <li> The <a href="/pkg/crypto/x509/#CreateCertificate"><code>CreateCertificate</code></a>
  348. function of the <a href="/pkg/crypto/tls/"><code>crypto/tls</code></a> package
  349. now supports parsing (and elsewhere, serialization) of PKCS #10 certificate
  350. signature requests.
  351. </li>
  352. <li>
  353. The formatted print functions of the <code>fmt</code> package now define <code>%F</code>
  354. as a synonym for <code>%f</code> when printing floating-point values.
  355. </li>
  356. <li>
  357. The <a href="/pkg/math/big/"><code>math/big</code></a> package's
  358. <a href="/pkg/math/big/#Int"><code>Int</code></a> and
  359. <a href="/pkg/math/big/#Rat"><code>Rat</code></a> types
  360. now implement
  361. <a href="/pkg/encoding/#TextMarshaler"><code>encoding.TextMarshaler</code></a> and
  362. <a href="/pkg/encoding/#TextUnmarshaler"><code>encoding.TextUnmarshaler</code></a>.
  363. </li>
  364. <li>
  365. The complex power function, <a href="/pkg/math/cmplx/#Pow"><code>Pow</code></a>,
  366. now specifies the behavior when the first argument is zero.
  367. It was undefined before.
  368. The details are in the <a href="/pkg/math/cmplx/#Pow">documentation for the function</a>.
  369. </li>
  370. <li>
  371. The <a href="/pkg/net/http/"><code>net/http</code></a> package now exposes the
  372. properties of a TLS connection used to make a client request in the new
  373. <a href="/pkg/net/http/#Response"><code>Response.TLS</code></a> field.
  374. </li>
  375. <li>
  376. The <a href="/pkg/net/http/"><code>net/http</code></a> package now
  377. allows setting an optional server error logger
  378. with <a href="/pkg/net/http/#Server"><code>Server.ErrorLog</code></a>.
  379. The default is still that all errors go to stderr.
  380. </li>
  381. <li>
  382. The <a href="/pkg/net/http/"><code>net/http</code></a> package now
  383. supports disabling HTTP keep-alive connections on the server
  384. with <a href="/pkg/net/http/#Server.SetKeepAlivesEnabled"><code>Server.SetKeepAlivesEnabled</code></a>.
  385. The default continues to be that the server does keep-alive (reuses
  386. connections for multiple requests) by default.
  387. Only resource-constrained servers or those in the process of graceful
  388. shutdown will want to disable them.
  389. </li>
  390. <li>
  391. The <a href="/pkg/net/http/"><code>net/http</code></a> package adds an optional
  392. <a href="/pkg/net/http/#Transport"><code>Transport.TLSHandshakeTimeout</code></a>
  393. setting to cap the amount of time HTTP client requests will wait for
  394. TLS handshakes to complete.
  395. It's now also set by default
  396. on <a href="/pkg/net/http#DefaultTransport"><code>DefaultTransport</code></a>.
  397. </li>
  398. <li>
  399. The <a href="/pkg/net/http/"><code>net/http</code></a> package's
  400. <a href="/pkg/net/http/#DefaultTransport"><code>DefaultTransport</code></a>,
  401. used by the HTTP client code, now
  402. enables <a href="http://en.wikipedia.org/wiki/Keepalive#TCP_keepalive">TCP
  403. keep-alives</a> by default.
  404. Other <a href="/pkg/net/http/#Transport"><code>Transport</code></a>
  405. values with a nil <code>Dial</code> field continue to function the same
  406. as before: no TCP keep-alives are used.
  407. </li>
  408. <li>
  409. The <a href="/pkg/net/http/"><code>net/http</code></a> package
  410. now enables <a href="http://en.wikipedia.org/wiki/Keepalive#TCP_keepalive">TCP
  411. keep-alives</a> for incoming server requests when
  412. <a href="/pkg/net/http/#ListenAndServe"><code>ListenAndServe</code></a>
  413. or
  414. <a href="/pkg/net/http/#ListenAndServeTLS"><code>ListenAndServeTLS</code></a>
  415. are used.
  416. When a server is started otherwise, TCP keep-alives are not enabled.
  417. </li>
  418. <li>
  419. The <a href="/pkg/net/http/"><code>net/http</code></a> package now
  420. provides an
  421. optional <a href="/pkg/net/http/#Server"><code>Server.ConnState</code></a>
  422. callback to hook various phases of a server connection's lifecycle
  423. (see <a href="/pkg/net/http/#ConnState"><code>ConnState</code></a>).
  424. This can be used to implement rate limiting or graceful shutdown.
  425. </li>
  426. <li>
  427. The <a href="/pkg/net/http/"><code>net/http</code></a> package's HTTP
  428. client now has an
  429. optional <a href="/pkg/net/http/#Client"><code>Client.Timeout</code></a>
  430. field to specify an end-to-end timeout on requests made using the
  431. client.
  432. </li>
  433. <li>
  434. The <a href="/pkg/net/http/"><code>net/http</code></a> package's
  435. <a href="/pkg/net/http/#Request.ParseMultipartForm"><code>Request.ParseMultipartForm</code></a>
  436. method will now return an error if the body's <code>Content-Type</code>
  437. is not <code>mutipart/form-data</code>.
  438. Prior to Go 1.3 it would silently fail and return <code>nil</code>.
  439. Code that relies on the previous behavior should be updated.
  440. </li>
  441. <li> In the <a href="/pkg/net/"><code>net</code></a> package,
  442. the <a href="/pkg/net/#Dialer"><code>Dialer</code></a> struct now
  443. has a <code>KeepAlive</code> option to specify a keep-alive period for the connection.
  444. </li>
  445. <li>
  446. The <a href="/pkg/net/http/"><code>net/http</code></a> package's
  447. <a href="/pkg/net/http/#Transport"><code>Transport</code></a>
  448. now closes <a href="/pkg/net/http/#Request"><code>Request.Body</code></a>
  449. consistently, even on error.
  450. </li>
  451. <li>
  452. The <a href="/pkg/os/exec/"><code>os/exec</code></a> package now implements
  453. what the documentation has always said with regard to relative paths for the binary.
  454. In particular, it only calls <a href="/pkg/os/exec/#LookPath"><code>LookPath</code></a>
  455. when the binary's file name contains no path separators.
  456. </li>
  457. <li>
  458. The <a href="/pkg/reflect/#Value.SetMapIndex"><code>SetMapIndex</code></a>
  459. function in the <a href="/pkg/reflect/"><code>reflect</code></a> package
  460. no longer panics when deleting from a <code>nil</code> map.
  461. </li>
  462. <li>
  463. If the main goroutine calls
  464. <a href="/pkg/runtime/#Goexit"><code>runtime.Goexit</code></a>
  465. and all other goroutines finish execution, the program now always crashes,
  466. reporting a detected deadlock.
  467. Earlier versions of Go handled this situation inconsistently: most instances
  468. were reported as deadlocks, but some trivial cases exited cleanly instead.
  469. </li>
  470. <li>
  471. The runtime/debug package now has a new function
  472. <a href="/pkg/runtime/debug/#WriteHeapDump"><code>debug.WriteHeapDump</code></a>
  473. that writes out a description of the heap.
  474. </li>
  475. <li>
  476. The <a href="/pkg/strconv/#CanBackquote"><code>CanBackquote</code></a>
  477. function in the <a href="/pkg/strconv/"><code>strconv</code></a> package
  478. now considers the <code>DEL</code> character, <code>U+007F</code>, to be
  479. non-printing.
  480. </li>
  481. <li>
  482. The <a href="/pkg/syscall/"><code>syscall</code></a> package now provides
  483. <a href="/pkg/syscall/#SendmsgN"><code>SendmsgN</code></a>
  484. as an alternate version of
  485. <a href="/pkg/syscall/#Sendmsg"><code>Sendmsg</code></a>
  486. that returns the number of bytes written.
  487. </li>
  488. <li>
  489. On Windows, the <a href="/pkg/syscall/"><code>syscall</code></a> package now
  490. supports the cdecl calling convention through the addition of a new function
  491. <a href="/pkg/syscall/#NewCallbackCDecl"><code>NewCallbackCDecl</code></a>
  492. alongside the existing function
  493. <a href="/pkg/syscall/#NewCallback"><code>NewCallback</code></a>.
  494. </li>
  495. <li>
  496. The <a href="/pkg/testing/"><code>testing</code></a> package now
  497. diagnoses tests that call <code>panic(nil)</code>, which are almost always erroneous.
  498. Also, tests now write profiles (if invoked with profiling flags) even on failure.
  499. </li>
  500. <li>
  501. The <a href="/pkg/unicode/"><code>unicode</code></a> package and associated
  502. support throughout the system has been upgraded from
  503. Unicode 6.2.0 to <a href="http://www.unicode.org/versions/Unicode6.3.0/">Unicode 6.3.0</a>.
  504. </li>
  505. </ul>