Lines Matching full:code
15 in the form of a backwards-compatible simple variant of <code>for</code>-<code>range</code> loop,
26 There are some new tools available including support in the <code>go</code> command
27 for build-time source code generation.
43 Up until Go 1.3, <code>for</code>-<code>range</code> loop had two forms
65 <code>for</code> <code>_</code> <code>=</code> <code>range</code> <code>x</code>), because
81 The pattern arises rarely but the code can be cleaner when it does.
88 <code>Key</code> field of <a href="/pkg/go/ast/#RangeStmt"><code>RangeStmt</code></a>
89 may now be <code>nil</code>.
105 both <code>gc</code> and <code>gccgo</code> accepted the method call
113 which is a double dereference of the pointer-to-pointer <code>x</code>.
121 <em>Updating</em>: Code that depends on the old, erroneous behavior will no longer
131 It can also build a <code>.so</code> library that can be loaded by an Android application
141 (<code>GOARCH=386</code>)
150 provided the kernel supports the <code>nsec</code> system call and uses 4K pages.
156 The <a href="/pkg/unsafe/"><code>unsafe</code></a> package allows one
159 It was never explicitly specified what use of <code>unsafe</code> meant
163 for code that does unsafe things.
169 docs for the <a href="/pkg/unsafe/"><code>unsafe</code></a> package
170 are now explicit that unsafe code is not guaranteed to remain compatible.
186 In 1.4, much of the code has been translated to Go so that the garbage collector can scan
237 In Go 1.4, setting the <a href="/pkg/runtime/"><code>GODEBUG</code></a> variable
238 <code>invalidptr=0</code> disables
240 able to avoid the crash; the correct fix is to rewrite code not to alias integers and pointers.
246 The language accepted by the assemblers <code>cmd/5a</code>, <code>cmd/6a</code>
247 and <code>cmd/8a</code> has had several changes,
252 First, the <code>textflag.h</code> file that defines flags for <code>TEXT</code> directives
265 definitions (<code>DATA</code> and <code>GLOBL</code> directives)
273 Assembly files that include <code>textflag.h</code> from its old
302 for instance to avoid acquiring clients of interfaces to code that is part of a public repository
308 <a href="/cmd/go/"><code>go</code></a> command introduces
314 To create such a package, place it in a directory named <code>internal</code> or in a subdirectory of a directory
316 When the <code>go</code> command sees an import of a package with <code>internal</code> in its path,
318 is within the tree rooted at the parent of the <code>internal</code> directory.
319 For example, a package <code>.../a/b/c/internal/d/e/f</code>
320 can be imported only by code in the directory tree rooted at <code>.../a/b/c</code>.
321 It cannot be imported by code in <code>.../a/b/g</code> or in any other repository.
337 Code often lives in repositories hosted by public services such as <code>github.com</code>,
339 <code>github.com/rsc/pdf</code> for example.
343 <code>rsc.io/pdf</code>, but
356 the <a href="/cmd/go/"><code>go</code></a> command
371 the <code>go</code> command will
372 refuse to compile a package that imports <code>github.com/rsc/pdf</code>,
373 ensuring that the code can be moved without breaking users.
377 The check is at build time, not download time, so if <code>go</code> <code>get</code>
385 The <code>go</code> <code>get</code> <code>-u</code> command will fail to
388 The new <code>-f</code> flag overrides this check.
399 The Go project subrepositories (<code>code.google.com/p/go.tools</code> and so on)
400 are now available under custom import paths replacing <code>code.google.com/p/go.</code> with <code>golang.org/x/</code>,
401 as in <code>golang.org/x/tools</code>.
402 We will add canonical import comments to the code around June 1, 2015,
403 at which point Go 1.4 and later will stop accepting the old <code>code.google.com</code> paths.
407 <em>Updating</em>: All code that imports from subrepositories should change
408 to use the new <code>golang.org</code> paths.
411 Code that has not updated will stop compiling with Go 1.4 around June 1, 2015.
417 The <a href="/cmd/go/"><code>go</code></a> command has a new subcommand,
418 <a href="/cmd/go/#hdr-Generate_Go_files_by_processing_source"><code>go generate</code></a>,
419 to automate the running of tools to generate source code before compilation.
420 For example, it can be used to run the <a href="/cmd/yacc"><code>yacc</code></a>
421 compiler-compiler on a <code>.y</code> file to produce the Go source file implementing the grammar,
422 or to automate the generation of <code>String</code> methods for typed constants using the new
424 tool in the <code>golang.org/x/tools</code> subrepository.
436 (see the documentation <a href="/pkg/go/build/"><code>/go/build</code></a>).
438 a suffix (before the <code>.go</code> or <code>.s</code> extension) with an underscore
440 For instance, the file <code>gopher_arm.go</code> will only be compiled if the target
445 Before Go 1.4, a file called just <code>arm.go</code> was similarly tagged, but this behavior
453 Files with names like <code>windows.go</code> or <code>amd64.go</code> should either
455 <code>os_windows.go</code> or <code>support_amd64.go</code>.
462 <a href="/cmd/go/"><code>cmd/go</code></a>
469 Unless <a href="/cmd/cgo/"><code>cgo</code></a> is being used to build the package,
470 the <code>go</code> command now refuses to compile C source files,
472 (<a href="/cmd/6c/"><code>6c</code></a> etc.)
480 The <a href="/cmd/go/#hdr-Test_packages"><code>go</code> <code>test</code></a>
481 subcommand has a new flag, <code>-o</code>, to set the name of the resulting binary,
483 The non-functional <code>-file</code> flag has been removed.
487 The <a href="/cmd/go/#hdr-Test_packages"><code>go</code> <code>test</code></a>
488 subcommand will compile and link all <code>*_test.go</code> files in the package,
489 even when there are no <code>Test</code> functions in them.
495 <a href="/cmd/go/#hdr-Test_packages"><code>go</code> <code>build</code></a>
497 <code>-a</code> flag has been changed for non-development installations.
498 For installations running a released distribution, the <code>-a</code> flag will no longer
507 In the main Go source repository, the source code for the packages was kept in
508 the directory <code>src/pkg</code>, which made sense but differed from
510 In Go 1.4, the<code> pkg</code> level of the source tree is now gone, so for example
511 the <a href="/pkg/fmt/"><code>fmt</code></a> package's source, once kept in
512 directory <code>src/pkg/fmt</code>, now lives one level higher in <code>src/fmt</code>.
516 <em>Updating</em>: Tools like <code>godoc</code> that discover source code
531 The standard repository's top-level <code>misc</code> directory used to contain
588 The <a href="/pkg/bufio/#Scanner"><code>Scanner</code></a> type in the
589 <a href="/pkg/bufio/"><code>bufio</code></a> package
591 <a href="/pkg/bufio/#SplitFunc"><code>split functions</code></a>.
608 The <a href="/pkg/syscall/"><code>syscall</code></a> package is now frozen except
631 <em>Updating</em>: Existing programs are not affected as the <code>syscall</code>
633 Future development that requires system calls not in the <code>syscall</code> package
634 should build on <code>golang.org/x/sys</code> instead.
647 The <a href="/pkg/archive/zip/"><code>archive/zip</code></a> package's
648 <a href="/pkg/archive/zip/#Writer"><code>Writer</code></a> now supports a
649 <a href="/pkg/archive/zip/#Writer.Flush"><code>Flush</code></a> method.
653 The <a href="/pkg/compress/flate/"><code>compress/flate</code></a>,
654 <a href="/pkg/compress/gzip/"><code>compress/gzip</code></a>,
655 and <a href="/pkg/compress/zlib/"><code>compress/zlib</code></a>
656 packages now support a <code>Reset</code> method
658 The <a href="/pkg/compress/gzip/"><code>compress/gzip</code></a> package also has a
659 <a href="/pkg/compress/gzip/#Reader.Multistream"><code>Multistream</code></a> method to control support
664 The <a href="/pkg/crypto/"><code>crypto</code></a> package now has a
665 <a href="/pkg/crypto/#Signer"><code>Signer</code></a> interface, implemented by the
666 <code>PrivateKey</code> types in
667 <a href="/pkg/crypto/ecdsa"><code>crypto/ecdsa</code></a> and
668 <a href="/pkg/crypto/rsa"><code>crypto/rsa</code></a>.
672 The <a href="/pkg/crypto/tls/"><code>crypto/tls</code></a> package
677 The <a href="/pkg/crypto/tls/"><code>crypto/tls</code></a> package
679 through the new <a href="/pkg/crypto/tls/#Config.CertificateForName"><code>CertificateForName</code></a> function
680 of the <a href="/pkg/crypto/tls/#Config"><code>Config</code></a> struct.
692 The <a href="/pkg/database/sql/"><code>database/sql</code></a> package can now list all registered
693 <a href="/pkg/database/sql/#Drivers"><code>Drivers</code></a>.
697 The <a href="/pkg/debug/dwarf/"><code>debug/dwarf</code></a> package now supports
698 <a href="/pkg/debug/dwarf/#UnspecifiedType"><code>UnspecifiedType</code></a>s.
702 In the <a href="/pkg/encoding/asn1/"><code>encoding/asn1</code></a> package,
707 The <a href="/pkg/encoding/csv/"><code>encoding/csv</code></a> package no longer
708 quotes empty strings but does quote the end-of-data marker <code>\.</code> (backslash dot).
713 The <a href="/pkg/encoding/gob/"><code>encoding/gob</code></a> package has been rewritten to eliminate
715 <a href="/pkg/unsafe/"><code>unsafe</code></a> package.
722 The <a href="/pkg/encoding/xml/"><code>encoding/xml</code></a> package's
723 <a href="/pkg/encoding/xml/#Decoder"><code>Decoder</code></a> can now report its input offset.
727 In the <a href="/pkg/fmt/"><code>fmt</code></a> package,
730 For instance, <code>&map[string]int{"one":</code> <code>1}</code> now prints by default as
731 <code>&map[one:</code> <code>1]</code> rather than as a hexadecimal pointer value.
735 The <a href="/pkg/image/"><code>image</code></a> package's
736 <a href="/pkg/image/#Image"><code>Image</code></a>
738 <a href="/pkg/image/#RGBA"><code>RGBA</code></a> and
739 <a href="/pkg/image/#Gray"><code>Gray</code></a> have specialized
740 <a href="/pkg/image/#RGBA.RGBAAt"><code>RGBAAt</code></a> and
741 <a href="/pkg/image/#Gray.GrayAt"><code>GrayAt</code></a> methods alongside the general
742 <a href="/pkg/image/#Image.At"><code>At</code></a> method.
746 The <a href="/pkg/image/png/"><code>image/png</code></a> package now has an
747 <a href="/pkg/image/png/#Encoder"><code>Encoder</code></a>
752 The <a href="/pkg/math/"><code>math</code></a> package now has a
753 <a href="/pkg/math/#Nextafter32"><code>Nextafter32</code><a/> function.
757 The <a href="/pkg/net/http/"><code>net/http</code></a> package's
758 <a href="/pkg/net/http/#Request"><code>Request</code></a> type
759 has a new <a href="/pkg/net/http/#Request.BasicAuth"><code>BasicAuth</code></a> method
765 <li>The <a href="/pkg/net/http/"><code>net/http</code></a> package's
766 <a href="/pkg/net/http/#Request"><code>Transport</code></a> type
767 has a new <a href="/pkg/net/http/#Transport.DialTLS"><code>DialTLS</code></a> hook
772 The <a href="/pkg/net/http/httputil/"><code>net/http/httputil</code></a> package's
773 <a href="/pkg/net/http/httputil/#ReverseProxy"><code>ReverseProxy</code></a> type
775 <a href="/pkg/net/http/#ReverseProxy.ErrorLog"><code>ErrorLog</code></a>, that
780 The <a href="/pkg/os/"><code>os</code></a> package
782 through the <a href="/pkg/os/#Symlink"><code>Symlink</code></a> function.
784 There is also a new <a href="/pkg/os/#Unsetenv"><code>Unsetenv</code></a> function.
788 The <a href="/pkg/reflect/"><code>reflect</code></a> package's
789 <a href="/pkg/reflect/#Type"><code>Type</code></a> interface
790 has a new method, <a href="/pkg/reflect/#type.Comparable"><code>Comparable</code></a>,
795 Also in the <a href="/pkg/reflect/"><code>reflect</code></a> package, the
796 <a href="/pkg/reflect/#Value"><code>Value</code></a> interface is now three instead of four words
802 The <a href="/pkg/runtime/"><code>runtime</code></a> package
808 The <a href="/pkg/runtime/"><code>runtime</code></a> package's
809 <a href="/pkg/runtime/#MemStats.Mallocs"><code>Mallocs</code></a> counter
811 This may break tests using <a href="/pkg/runtime/#ReadMemStats"><code>ReadMemStats</code></a>
812 or <a href="/pkg/testing/#AllocsPerRun"><code>AllocsPerRun</code></a>
817 In the <a href="/pkg/runtime/"><code>runtime</code></a> package,
818 an array <a href="/pkg/runtime/#MemStats.PauseEnd"><code>PauseEnd</code></a>
820 <a href="/pkg/runtime/#MemStats"><code>MemStats</code></a>
821 and <a href="/pkg/runtime/#GCStats"><code>GCStats</code></a> structs.
824 <a href="/pkg/runtime/#MemStats.PauseNs"><code>PauseNs</code></a>
828 The <a href="/pkg/runtime/race/"><code>runtime/race</code></a> package
830 <a href="/pkg/cmd/go/"><code>go</code></a> command's <code>-race</code>
835 The <a href="/pkg/sync/atomic/"><code>sync/atomic</code></a> package
836 has a new type, <a href="/pkg/sync/atomic/#Value"><code>Value</code></a>.
837 <code>Value</code> provides an efficient mechanism for atomic loads and
842 In the <a href="/pkg/syscall/"><code>syscall</code></a> package's
844 <a href="/pkg/syscall/#Setuid"><code>Setuid</code></a>
845 and <a href="/pkg/syscall/#Setgid"><code>Setgid</code></a> have been disabled
851 The <a href="/pkg/testing/"><code>testing</code></a> package
853 If the test code contains a function
855 func TestMain(m *<a href="/pkg/testing/#M"><code>testing.M</code></a>)
859 The <code>M</code> struct contains methods to access and run the tests.
863 Also in the <a href="/pkg/testing/"><code>testing</code></a> package,
864 a new <a href="/pkg/testing/#Coverage"><code>Coverage</code></a>
871 The <a href="/pkg/text/scanner/"><code>text/scanner</code></a> package's
872 <a href="/pkg/text/scanner/#Scanner"><code>Scanner</code></a> type
874 <a href="/pkg/text/scanner/#Scanner.IsIdentRune"><code>IsIdentRune</code></a>,
879 The <a href="/pkg/text/template/"><code>text/template</code
880 functions <code>eq</code>, <code>lt</code>, and so on have been generalized to allow comparison
887 The <code>time</code> package now uses the standard symbol for the micro prefix,
889 <a href="/pkg/time/#ParseDuration"><code>ParseDuration</code></a> still accepts <code>us</code>
890 but the package no longer prints microseconds as <code>us</code>.
892 <em>Updating</em>: Code that depends on the output format of durations