Commit 359747da authored by Keith Randall's avatar Keith Randall

[dev.ssa] Merge remote-tracking branch 'origin/master' into mergebranch

Semi-regular merge from tip into ssa branch

Change-Id: Ida553b5c504058347c0bdcb1a987727bdcea456b
parents 4b803151 e0c180c4
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -3172,40 +3172,44 @@ count the completion signals by draining the channel after ...@@ -3172,40 +3172,44 @@ count the completion signals by draining the channel after
launching all the goroutines. launching all the goroutines.
</p> </p>
<pre> <pre>
const NCPU = 4 // number of CPU cores const numCPU = 4 // number of CPU cores
func (v Vector) DoAll(u Vector) { func (v Vector) DoAll(u Vector) {
c := make(chan int, NCPU) // Buffering optional but sensible. c := make(chan int, numCPU) // Buffering optional but sensible.
for i := 0; i &lt; NCPU; i++ { for i := 0; i &lt; numCPU; i++ {
go v.DoSome(i*len(v)/NCPU, (i+1)*len(v)/NCPU, u, c) go v.DoSome(i*len(v)/numCPU, (i+1)*len(v)/numCPU, u, c)
} }
// Drain the channel. // Drain the channel.
for i := 0; i &lt; NCPU; i++ { for i := 0; i &lt; numCPU; i++ {
&lt;-c // wait for one task to complete &lt;-c // wait for one task to complete
} }
// All done. // All done.
} }
</pre> </pre>
<p> <p>
The current implementation of the Go runtime Rather than create a constant value for numCPU, we can ask the runtime what
will not parallelize this code by default. value is appropriate.
It dedicates only a single core to user-level processing. An The function <code><a href="/pkg/runtime#NumCPU">runtime.NumCPU</a></code>
arbitrary number of goroutines can be blocked in system calls, but returns the number of hardware CPU cores in the machine, so we could write
by default only one can be executing user-level code at any time.
It should be smarter and one day it will be smarter, but until it
is if you want CPU parallelism you must tell the run-time
how many goroutines you want executing code simultaneously. There
are two related ways to do this. Either run your job with environment
variable <code>GOMAXPROCS</code> set to the number of cores to use
or import the <code>runtime</code> package and call
<code>runtime.GOMAXPROCS(NCPU)</code>.
A helpful value might be <code>runtime.NumCPU()</code>, which reports the number
of logical CPUs on the local machine.
Again, this requirement is expected to be retired as the scheduling and run-time improve.
</p> </p>
<pre>
var numCPU = runtime.NumCPU()
</pre>
<p>
There is also a function
<code><a href="/pkg/runtime#GOMAXPROCS">runtime.GOMAXPROCS</a></code>,
which reports (or sets)
the user-specified number of cores that a Go program can have running
simultaneously.
It defaults to the value of <code>runtime.NumCPU</code> but can be
overridden by setting the similarly named shell environment variable
or by calling the function with a positive number. Calling it with
zero just queries the value.
Therefore if we want to honor the user's resource request, we should write
</p>
<pre>
var numCPU = runtime.GOMAXPROCS(0)
</pre>
<p> <p>
Be sure not to confuse the ideas of concurrency—structuring a program Be sure not to confuse the ideas of concurrency—structuring a program
as independently executing components—and parallelism—executing as independently executing components—and parallelism—executing
......
...@@ -183,7 +183,7 @@ export LIBRARY_PATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH ...@@ -183,7 +183,7 @@ export LIBRARY_PATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH
The gccgo compiler works like other gcc frontends. As of GCC 5 the gccgo The gccgo compiler works like other gcc frontends. As of GCC 5 the gccgo
installation also includes a version of the <code>go</code> command, installation also includes a version of the <code>go</code> command,
which may be used to build Go programs as described at which may be used to build Go programs as described at
<a href="http://golang.org/cmd/go">http://golang.org/cmd/go</a>. <a href="https://golang.org/cmd/go">https://golang.org/cmd/go</a>.
</p> </p>
<p> <p>
......
This diff is collapsed.
...@@ -95,6 +95,18 @@ We therefore recommend that composite literals whose type is defined ...@@ -95,6 +95,18 @@ We therefore recommend that composite literals whose type is defined
in a separate package should use the keyed notation. in a separate package should use the keyed notation.
</li> </li>
<li>
Methods. As with struct fields, it may be necessary to add methods
to types.
Under some circumstances, such as when the type is embedded in
a struct along with another type,
the addition of the new method may break
the struct by creating a conflict with an existing method of the other
embedded type.
We cannot protect against this rare case and do not guarantee compatibility
should it arise.
</li>
<li> <li>
Dot imports. If a program imports a standard package Dot imports. If a program imports a standard package
using <code>import . "path"</code>, additional names defined in the using <code>import . "path"</code>, additional names defined in the
......
...@@ -92,13 +92,6 @@ portability and the addition of new functionality such as improved support for i ...@@ -92,13 +92,6 @@ portability and the addition of new functionality such as improved support for i
There may well be a Go 2 one day, but not for a few years and it will be influenced by what we learn using Go 1 as it is today. There may well be a Go 2 one day, but not for a few years and it will be influenced by what we learn using Go 1 as it is today.
</p> </p>
<h3 id="What_is_the_origin_of_the_name">
What is the origin of the name?</h3>
<p>
&ldquo;Ogle&rdquo; would be a good name for a Go debugger.
</p>
<h3 id="Whats_the_origin_of_the_mascot"> <h3 id="Whats_the_origin_of_the_mascot">
What's the origin of the mascot?</h3> What's the origin of the mascot?</h3>
...@@ -893,7 +886,7 @@ encourages you to be explicit. ...@@ -893,7 +886,7 @@ encourages you to be explicit.
</p> </p>
<p> <p>
A blog post titled <a href="http://blog.golang.org/constants">Constants</a> A blog post titled <a href="https://blog.golang.org/constants">Constants</a>
explores this topic in more detail. explores this topic in more detail.
</p> </p>
...@@ -1591,6 +1584,51 @@ test cases. The standard Go library is full of illustrative examples, such as in ...@@ -1591,6 +1584,51 @@ test cases. The standard Go library is full of illustrative examples, such as in
<a href="/src/fmt/fmt_test.go">the formatting tests for the <code>fmt</code> package</a>. <a href="/src/fmt/fmt_test.go">the formatting tests for the <code>fmt</code> package</a>.
</p> </p>
<h3 id="x_in_std">
Why isn't <i>X</i> in the standard library?</h3>
<p>
The standard library's purpose is to support the runtime, connect to
the operating system, and provide key functionality that many Go
programs require, such as formatted I/O and networking.
It also contains elements important for web programming, including
cryptography and support for standards like HTTP, JSON, and XML.
</p>
<p>
There is no clear criterion that defines what is included because for
a long time, this was the <i>only</i> Go library.
There are criteria that define what gets added today, however.
</p>
<p>
New additions to the standard library are rare and the bar for
inclusion is high.
Code included in the standard library bears a large ongoing maintenance cost
(often borne by those other than the original author),
is subject to the <a href="/doc/go1compat.html">Go 1 compatibility promise</a>
(blocking fixes to any flaws in the API),
and is subject to the Go
<a href="https://golang.org/s/releasesched">release schedule</a>,
preventing bug fixes from being available to users quickly.
</p>
<p>
Most new code should live outside of the standard library and be accessible
via the <a href="/cmd/go/"><code>go</code> tool</a>'s
<code>go get</code> command.
Such code can have its own maintainers, release cycle,
and compatibility guarantees.
Users can find packages and read their documentation at
<a href="https://godoc.org/">godoc.org</a>.
</p>
<p>
Although there are pieces in the standard library that don't really belong,
such as <code>log/syslog</code>, we continue to maintain everything in the
library because of the Go 1 compatibility promise.
But we encourage most new code to live elsewhere.
</p>
<h2 id="Implementation">Implementation</h2> <h2 id="Implementation">Implementation</h2>
......
<!--{ <!--{
"Title": "The Go Programming Language Specification", "Title": "The Go Programming Language Specification",
"Subtitle": "Version of June 23, 2015", "Subtitle": "Version of July 23, 2015",
"Path": "/ref/spec" "Path": "/ref/spec"
}--> }-->
...@@ -129,27 +129,27 @@ hex_digit = "0" … "9" | "A" … "F" | "a" … "f" . ...@@ -129,27 +129,27 @@ hex_digit = "0" … "9" | "A" … "F" | "a" … "f" .
<h3 id="Comments">Comments</h3> <h3 id="Comments">Comments</h3>
<p> <p>
There are two forms of comments: Comments serve as program documentation. There are two forms:
</p> </p>
<ol> <ol>
<li> <li>
<i>Line comments</i> start with the character sequence <code>//</code> <i>Line comments</i> start with the character sequence <code>//</code>
and stop at the end of the line. A line comment acts like a newline. and stop at the end of the line.
</li> </li>
<li> <li>
<i>General comments</i> start with the character sequence <code>/*</code> <i>General comments</i> start with the character sequence <code>/*</code>
and continue through the character sequence <code>*/</code>. A general and stop with the first subsequent character sequence <code>*/</code>.
comment containing one or more newlines acts like a newline, otherwise it acts
like a space.
</li> </li>
</ol> </ol>
<p> <p>
Comments do not nest. A comment cannot start inside a <a href="#Rune_literals">rune</a> or
<a href="#String_literals">string literal</a>, or inside a comment.
A general comment containing no newlines acts like a space.
Any other comment acts like a newline.
</p> </p>
<h3 id="Tokens">Tokens</h3> <h3 id="Tokens">Tokens</h3>
<p> <p>
...@@ -176,11 +176,8 @@ using the following two rules: ...@@ -176,11 +176,8 @@ using the following two rules:
<ol> <ol>
<li> <li>
<p>
When the input is broken into tokens, a semicolon is automatically inserted When the input is broken into tokens, a semicolon is automatically inserted
into the token stream at the end of a non-blank line if the line's final into the token stream immediately after a line's final token if that token is
token is
</p>
<ul> <ul>
<li>an <li>an
<a href="#Identifiers">identifier</a> <a href="#Identifiers">identifier</a>
...@@ -357,9 +354,10 @@ imaginary_lit = (decimals | float_lit) "i" . ...@@ -357,9 +354,10 @@ imaginary_lit = (decimals | float_lit) "i" .
<p> <p>
A rune literal represents a <a href="#Constants">rune constant</a>, A rune literal represents a <a href="#Constants">rune constant</a>,
an integer value identifying a Unicode code point. an integer value identifying a Unicode code point.
A rune literal is expressed as one or more characters enclosed in single quotes. A rune literal is expressed as one or more characters enclosed in single quotes,
Within the quotes, any character may appear except single as in <code>'x'</code> or <code>'\n'</code>.
quote and newline. A single quoted character represents the Unicode value Within the quotes, any character may appear except newline and unescaped single
quote. A single quoted character represents the Unicode value
of the character itself, of the character itself,
while multi-character sequences beginning with a backslash encode while multi-character sequences beginning with a backslash encode
values in various formats. values in various formats.
...@@ -433,6 +431,7 @@ escaped_char = `\` ( "a" | "b" | "f" | "n" | "r" | "t" | "v" | `\` | "'" | ` ...@@ -433,6 +431,7 @@ escaped_char = `\` ( "a" | "b" | "f" | "n" | "r" | "t" | "v" | `\` | "'" | `
'\xff' '\xff'
'\u12e4' '\u12e4'
'\U00101234' '\U00101234'
'\'' // rune literal containing single quote character
'aa' // illegal: too many characters 'aa' // illegal: too many characters
'\xa' // illegal: too few hexadecimal digits '\xa' // illegal: too few hexadecimal digits
'\0' // illegal: too few octal digits '\0' // illegal: too few octal digits
...@@ -449,8 +448,8 @@ obtained from concatenating a sequence of characters. There are two forms: ...@@ -449,8 +448,8 @@ obtained from concatenating a sequence of characters. There are two forms:
raw string literals and interpreted string literals. raw string literals and interpreted string literals.
</p> </p>
<p> <p>
Raw string literals are character sequences between back quotes Raw string literals are character sequences between back quotes, as in
<code>``</code>. Within the quotes, any character is legal except <code>`foo`</code>. Within the quotes, any character may appear except
back quote. The value of a raw string literal is the back quote. The value of a raw string literal is the
string composed of the uninterpreted (implicitly UTF-8-encoded) characters string composed of the uninterpreted (implicitly UTF-8-encoded) characters
between the quotes; between the quotes;
...@@ -461,8 +460,9 @@ are discarded from the raw string value. ...@@ -461,8 +460,9 @@ are discarded from the raw string value.
</p> </p>
<p> <p>
Interpreted string literals are character sequences between double Interpreted string literals are character sequences between double
quotes <code>&quot;&quot;</code>. The text between the quotes, quotes, as in <code>&quot;bar&quot;</code>.
which may not contain newlines, forms the Within the quotes, any character may appear except newline and unescaped double quote.
The text between the quotes forms the
value of the literal, with backslash escapes interpreted as they value of the literal, with backslash escapes interpreted as they
are in <a href="#Rune_literals">rune literals</a> (except that <code>\'</code> is illegal and are in <a href="#Rune_literals">rune literals</a> (except that <code>\'</code> is illegal and
<code>\"</code> is legal), with the same restrictions. <code>\"</code> is legal), with the same restrictions.
...@@ -484,17 +484,17 @@ interpreted_string_lit = `"` { unicode_value | byte_value } `"` . ...@@ -484,17 +484,17 @@ interpreted_string_lit = `"` { unicode_value | byte_value } `"` .
</pre> </pre>
<pre> <pre>
`abc` // same as "abc" `abc` // same as "abc"
`\n `\n
\n` // same as "\\n\n\\n" \n` // same as "\\n\n\\n"
"\n" "\n"
"" "\"" // same as `"`
"Hello, world!\n" "Hello, world!\n"
"日本語" "日本語"
"\u65e5本\U00008a9e" "\u65e5本\U00008a9e"
"\xff\u00FF" "\xff\u00FF"
"\uD800" // illegal: surrogate half "\uD800" // illegal: surrogate half
"\U00110000" // illegal: invalid Unicode code point "\U00110000" // illegal: invalid Unicode code point
</pre> </pre>
<p> <p>
...@@ -2090,7 +2090,7 @@ Receiver = Parameters . ...@@ -2090,7 +2090,7 @@ Receiver = Parameters .
</pre> </pre>
<p> <p>
The receiver is specified via an extra parameter section preceeding the method The receiver is specified via an extra parameter section preceding the method
name. That parameter section must declare a single parameter, the receiver. name. That parameter section must declare a single parameter, the receiver.
Its type must be of the form <code>T</code> or <code>*T</code> (possibly using Its type must be of the form <code>T</code> or <code>*T</code> (possibly using
parentheses) where <code>T</code> is a type name. The type denoted by <code>T</code> is called parentheses) where <code>T</code> is a type name. The type denoted by <code>T</code> is called
......
The Go gopher was designed by Renee French. (http://reneefrench.blogspot.com/) The Go gopher was designed by Renee French. (http://reneefrench.blogspot.com/)
The design is licensed under the Creative Commons 3.0 Attributions license. The design is licensed under the Creative Commons 3.0 Attributions license.
Read this article for more details: http://blog.golang.org/gopher Read this article for more details: https://blog.golang.org/gopher
...@@ -487,6 +487,7 @@ The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are: ...@@ -487,6 +487,7 @@ The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are:
<td></td><td><code>windows</code></td> <td><code>amd64</code></td> <td></td><td><code>windows</code></td> <td><code>amd64</code></td>
</tr> </tr>
</table> </table>
<br>
<li><code>$GOHOSTOS</code> and <code>$GOHOSTARCH</code> <li><code>$GOHOSTOS</code> and <code>$GOHOSTARCH</code>
<p> <p>
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
# downloaded from the ICANN/IANA distribution. # downloaded from the ICANN/IANA distribution.
# Versions to use. # Versions to use.
CODE=2014j CODE=2015e
DATA=2014j DATA=2015e
set -e set -e
rm -rf work rm -rf work
......
No preview for this file type
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// Test that the #cgo CFLAGS directive works, // Test that the #cgo CFLAGS directive works,
// with and without platform filters. // with and without platform filters.
// See http://golang.org/issue/5224 for details. // See https://golang.org/issue/5224 for details.
package cgotest package cgotest
/* /*
......
...@@ -64,5 +64,6 @@ func TestReturnAfterGrowFromGo(t *testing.T) { testReturnAfterGrowFromGo(t) } ...@@ -64,5 +64,6 @@ func TestReturnAfterGrowFromGo(t *testing.T) { testReturnAfterGrowFromGo(t) }
func Test9026(t *testing.T) { test9026(t) } func Test9026(t *testing.T) { test9026(t) }
func Test9557(t *testing.T) { test9557(t) } func Test9557(t *testing.T) { test9557(t) }
func Test10303(t *testing.T) { test10303(t, 10) } func Test10303(t *testing.T) { test10303(t, 10) }
func Test11925(t *testing.T) { test11925(t) }
func BenchmarkCgoCall(b *testing.B) { benchCgoCall(b) } func BenchmarkCgoCall(b *testing.B) { benchCgoCall(b) }
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Issue 11925. Structs with zero-length trailing fields are now
// padded by the Go compiler.
package cgotest
/*
struct a11925 {
int i;
char a[0];
char b[0];
};
struct b11925 {
int i;
char a[0];
char b[];
};
*/
import "C"
import (
"testing"
"unsafe"
)
func test11925(t *testing.T) {
if C.sizeof_struct_a11925 != unsafe.Sizeof(C.struct_a11925{}) {
t.Errorf("size of a changed: C %d, Go %d", C.sizeof_struct_a11925, unsafe.Sizeof(C.struct_a11925{}))
}
if C.sizeof_struct_b11925 != unsafe.Sizeof(C.struct_b11925{}) {
t.Errorf("size of b changed: C %d, Go %d", C.sizeof_struct_b11925, unsafe.Sizeof(C.struct_b11925{}))
}
}
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
package cgotest package cgotest
// Test that cgo reserves enough stack space during cgo call. // Test that cgo reserves enough stack space during cgo call.
// See http://golang.org/issue/3945 for details. // See https://golang.org/issue/3945 for details.
// #include <stdio.h> // #include <stdio.h>
// //
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// Test that pthread_cancel works as expected // Test that pthread_cancel works as expected
// (NPTL uses SIGRTMIN to implement thread cancellation) // (NPTL uses SIGRTMIN to implement thread cancellation)
// See http://golang.org/issue/6997 // See https://golang.org/issue/6997
package cgotest package cgotest
/* /*
......
...@@ -7,7 +7,7 @@ package cgotest ...@@ -7,7 +7,7 @@ package cgotest
import "testing" import "testing"
// This test actually doesn't have anything to do with cgo. It is a // This test actually doesn't have anything to do with cgo. It is a
// test of http://golang.org/issue/7234, a compiler/linker bug in // test of https://golang.org/issue/7234, a compiler/linker bug in
// handling string constants when using -linkmode=external. The test // handling string constants when using -linkmode=external. The test
// is in this directory because we routinely test -linkmode=external // is in this directory because we routinely test -linkmode=external
// here. // here.
......
...@@ -20,6 +20,7 @@ struct issue8428two { ...@@ -20,6 +20,7 @@ struct issue8428two {
void *p; void *p;
char b; char b;
char rest[0]; char rest[0];
char pad;
}; };
struct issue8428three { struct issue8428three {
...@@ -34,8 +35,10 @@ import "C" ...@@ -34,8 +35,10 @@ import "C"
import "unsafe" import "unsafe"
var _ = C.struct_issue8428one{ var _ = C.struct_issue8428one{
b: C.char(0), b: C.char(0),
rest: [0]C.char{}, // The trailing rest field is not available in cgo.
// See issue 11925.
// rest: [0]C.char{},
} }
var _ = C.struct_issue8428two{ var _ = C.struct_issue8428two{
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// Test that setgid does not hang on GNU/Linux. // Test that setgid does not hang on GNU/Linux.
// See http://golang.org/issue/3871 for details. // See https://golang.org/issue/3871 for details.
package cgotest package cgotest
......
...@@ -143,6 +143,10 @@ func testMain(m *testing.M) (int, error) { ...@@ -143,6 +143,10 @@ func testMain(m *testing.M) (int, error) {
} }
func TestMain(m *testing.M) { func TestMain(m *testing.M) {
// Some of the tests install binaries into a custom GOPATH.
// That won't work if GOBIN is set.
os.Unsetenv("GOBIN")
flag.Parse() flag.Parse()
exitCode, err := testMain(m) exitCode, err := testMain(m)
if err != nil { if err != nil {
......
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//+build !gccgo
#include "textflag.h"
TEXT ·ImplementedInAsm(SB),NOSPLIT,$0-0
RET
//+build gccgo
package dep
func ImplementedInAsm() {}
//+build !gccgo
package dep
func ImplementedInAsm()
package main package main
import "dep" import (
"dep"
"runtime"
)
func main() { func main() {
defer dep.ImplementedInAsm()
runtime.GC()
dep.V = dep.F() + 1 dep.V = dep.F() + 1
} }
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# define VAR __declspec(dllimport) # define VAR __declspec(dllimport)
#endif #endif
#else #else
# define VAR # define VAR extern
#endif #endif
VAR const char *exported_var; VAR const char *exported_var;
...@@ -23,7 +23,7 @@ function urlForInput(t) { ...@@ -23,7 +23,7 @@ function urlForInput(t) {
} }
if (gerritChangeIdRE.test(t)) { if (gerritChangeIdRE.test(t)) {
return "http://golang.org/cl/" + t; return "https://golang.org/cl/" + t;
} }
var match = commitRE.exec(t); var match = commitRE.exec(t);
...@@ -34,7 +34,7 @@ function urlForInput(t) { ...@@ -34,7 +34,7 @@ function urlForInput(t) {
if (pkgRE.test(t)) { if (pkgRE.test(t)) {
// TODO: make this smarter, using a list of packages + substring matches. // TODO: make this smarter, using a list of packages + substring matches.
// Get the list from godoc itself in JSON format? // Get the list from godoc itself in JSON format?
return "http://golang.org/pkg/" + t; return "https://golang.org/pkg/" + t;
} }
return null; return null;
......
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<installer-script minSpecVersion="1.000000">
<title>Go</title>
<background mime-type="image/png" file="bg.png"/>
<options customize="never" allow-external-scripts="no"/>
<domains enable_localSystem="true" />
<installation-check script="installCheck();"/>
<script>
function installCheck() {
if(!(system.compareVersions(system.version.ProductVersion, '10.6.0') >= 0)) {
my.result.title = 'Unable to install';
my.result.message = 'Go requires Mac OS X 10.6 or later.';
my.result.type = 'Fatal';
return false;
}
if(system.files.fileExistsAtPath('/usr/local/go/bin/go')) {
my.result.title = 'Previous Installation Detected';
my.result.message = 'A previous installation of Go exists at /usr/local/go. This installer will remove the previous installation prior to installing. Please back up any data before proceeding.';
my.result.type = 'Warning';
return false;
}
return true;
}
</script>
<choices-outline>
<line choice="com.googlecode.go.choice"/>
</choices-outline>
<choice id="com.googlecode.go.choice" title="Go">
<pkg-ref id="com.googlecode.go.pkg"/>
</choice>
<pkg-ref id="com.googlecode.go.pkg" auth="Root">com.googlecode.go.pkg</pkg-ref>
</installer-script>
#!/bin/bash
GOROOT=/usr/local/go
echo "Fixing permissions"
cd $GOROOT
find . -exec chmod ugo+r \{\} \;
find bin -exec chmod ugo+rx \{\} \;
find . -type d -exec chmod ugo+rx \{\} \;
chmod o-w .
#!/bin/bash
GOROOT=/usr/local/go
echo "Removing previous installation"
if [ -d $GOROOT ]; then
rm -r $GOROOT
fi
This diff is collapsed.
Windows build dependencies
- Mercurial (hg): http://mercurial.selenic.com/
- MinGW: http://www.mingw.org/
- Windows Installer XML (WiX) toolset: http://wix.sourceforge.net/
Packaging
The dependencies must be in/added to the system's search PATH.
Run bindist as normal, eg:
bindist windows-386
TODO
- Documentation server shortcut checkbox option
Misc
WiX box sizes:
- banner size: 493x58
- left side of dialog: 164x312
- full dialog size: 493x312
This diff is collapsed.
...@@ -11,7 +11,7 @@ Go 1.3 supports three architectures ...@@ -11,7 +11,7 @@ Go 1.3 supports three architectures
limited to a 4gb window. limited to a 4gb window.
* nacl/arm which is 32-bit ARMv7A architecture with 1GB address space. * nacl/arm which is 32-bit ARMv7A architecture with 1GB address space.
For background it is recommended that you read http://golang.org/s/go13nacl. For background it is recommended that you read https://golang.org/s/go13nacl.
Prerequisites Prerequisites
------------- -------------
......
...@@ -2,7 +2,7 @@ This directory contains helper file for trace viewer (`go tool trace`). ...@@ -2,7 +2,7 @@ This directory contains helper file for trace viewer (`go tool trace`).
`trace_viewer_lean.html` was generated by following `trace_viewer_lean.html` was generated by following
[instructions](https://github.com/google/trace-viewer/wiki/Embedding) [instructions](https://github.com/google/trace-viewer/wiki/Embedding)
on revision `3c695b420a09db9933686fa958f1765c373c372e` using: on revision `280626ef607decf36291e290d5f0322b173e8a7f` using:
``` ```
trace-viewer$ ./vulcanize_trace_viewer --config=lean trace-viewer$ ./vulcanize_trace_viewer --config=lean
trace-viewer$ cp bin/trace_viewer_lean.html $GOROOT/misc/trace/ trace-viewer$ cp bin/trace_viewer_lean.html $GOROOT/misc/trace/
......
This diff is collapsed.
...@@ -35,6 +35,13 @@ GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH go build \ ...@@ -35,6 +35,13 @@ GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH go build \
-o ../bin/go_android_${GOARCH}_exec \ -o ../bin/go_android_${GOARCH}_exec \
../misc/android/go_android_exec.go ../misc/android/go_android_exec.go
export ANDROID_TEST_DIR=/tmp/androidtest-$$
function cleanup() {
rm -rf ${ANDROID_TEST_DIR}
}
trap cleanup EXIT
# Push GOROOT to target device. # Push GOROOT to target device.
# #
# The adb sync command will sync either the /system or /data # The adb sync command will sync either the /system or /data
...@@ -42,7 +49,7 @@ GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH go build \ ...@@ -42,7 +49,7 @@ GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH go build \
# on the host. We copy the files required for running tests under # on the host. We copy the files required for running tests under
# /data/local/tmp/goroot. The adb sync command does not follow # /data/local/tmp/goroot. The adb sync command does not follow
# symlinks so we have to copy. # symlinks so we have to copy.
export ANDROID_PRODUCT_OUT=/tmp/androidtest-$$ export ANDROID_PRODUCT_OUT="${ANDROID_TEST_DIR}/out"
FAKE_GOROOT=$ANDROID_PRODUCT_OUT/data/local/tmp/goroot FAKE_GOROOT=$ANDROID_PRODUCT_OUT/data/local/tmp/goroot
mkdir -p $FAKE_GOROOT mkdir -p $FAKE_GOROOT
mkdir -p $FAKE_GOROOT/pkg mkdir -p $FAKE_GOROOT/pkg
...@@ -54,17 +61,15 @@ echo '# Syncing test files to android device' ...@@ -54,17 +61,15 @@ echo '# Syncing test files to android device'
adb shell mkdir -p /data/local/tmp/goroot adb shell mkdir -p /data/local/tmp/goroot
time adb sync data &> /dev/null time adb sync data &> /dev/null
export CLEANER=/tmp/androidcleaner-$$ export CLEANER=${ANDROID_TEST_DIR}/androidcleaner-$$
cp ../misc/android/cleaner.go $CLEANER.go cp ../misc/android/cleaner.go $CLEANER.go
echo 'var files = `' >> $CLEANER.go echo 'var files = `' >> $CLEANER.go
(cd $ANDROID_PRODUCT_OUT/data/local/tmp/goroot; find . >> $CLEANER.go) (cd $ANDROID_PRODUCT_OUT/data/local/tmp/goroot; find . >> $CLEANER.go)
echo '`' >> $CLEANER.go echo '`' >> $CLEANER.go
go build -o $CLEANER $CLEANER.go go build -o $CLEANER $CLEANER.go
adb push $CLEANER /data/local/tmp/cleaner adb push $CLEANER /data/local/tmp/cleaner
rm $CLEANER $CLEANER.go
adb shell /data/local/tmp/cleaner adb shell /data/local/tmp/cleaner
rm -rf "$ANDROID_PRODUCT_OUT"
echo '' echo ''
# Run standard tests. # Run standard tests.
......
...@@ -400,7 +400,6 @@ func (b *Reader) ReadBytes(delim byte) (line []byte, err error) { ...@@ -400,7 +400,6 @@ func (b *Reader) ReadBytes(delim byte) (line []byte, err error) {
// accumulating full buffers. // accumulating full buffers.
var frag []byte var frag []byte
var full [][]byte var full [][]byte
err = nil
for { for {
var e error var e error
......
...@@ -115,7 +115,7 @@ func TestCompareAPI(t *testing.T) { ...@@ -115,7 +115,7 @@ func TestCompareAPI(t *testing.T) {
out: "", out: "",
}, },
{ {
// http://golang.org/issue/4303 // https://golang.org/issue/4303
name: "contexts reconverging", name: "contexts reconverging",
required: []string{ required: []string{
"A", "A",
......
...@@ -26,7 +26,7 @@ func main() { ...@@ -26,7 +26,7 @@ func main() {
} }
out, err := exec.Command("go", "tool", "api", out, err := exec.Command("go", "tool", "api",
"-c", file("go1", "go1.1", "go1.2", "go1.3", "go1.4"), "-c", file("go1", "go1.1", "go1.2", "go1.3", "go1.4", "go1.5"),
"-next", file("next"), "-next", file("next"),
"-except", file("except")).CombinedOutput() "-except", file("except")).CombinedOutput()
if err != nil { if err != nil {
......
...@@ -79,6 +79,7 @@ var armJump = map[string]bool{ ...@@ -79,6 +79,7 @@ var armJump = map[string]bool{
"BGT": true, "BGT": true,
"BLE": true, "BLE": true,
"CALL": true, "CALL": true,
"JMP": true,
} }
func jumpArm(word string) bool { func jumpArm(word string) bool {
......
...@@ -42,6 +42,7 @@ var arm64Jump = map[string]bool{ ...@@ -42,6 +42,7 @@ var arm64Jump = map[string]bool{
"CBZW": true, "CBZW": true,
"CBNZ": true, "CBNZ": true,
"CBNZW": true, "CBNZW": true,
"JMP": true,
} }
func jumpArm64(word string) bool { func jumpArm64(word string) bool {
......
...@@ -12,7 +12,7 @@ import "cmd/internal/obj/ppc64" ...@@ -12,7 +12,7 @@ import "cmd/internal/obj/ppc64"
func jumpPPC64(word string) bool { func jumpPPC64(word string) bool {
switch word { switch word {
case "BC", "BCL", "BEQ", "BGE", "BGT", "BL", "BLE", "BLT", "BNE", "BR", "BVC", "BVS", "CALL": case "BC", "BCL", "BEQ", "BGE", "BGT", "BL", "BLE", "BLT", "BNE", "BR", "BVC", "BVS", "CALL", "JMP":
return true return true
} }
return false return false
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment