Skip to content

Commit 4cfc3b7

Browse files
authored
Merge pull request #1 from golang/master
merge from golang
2 parents 7003ff1 + cc09212 commit 4cfc3b7

File tree

639 files changed

+73178
-19308
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

639 files changed

+73178
-19308
lines changed

doc/asm.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,12 @@ <h3 id="mips">MIPS, MIPS64</h3>
939939
<code>GOMIPS_hardfloat</code> or <code>GOMIPS_softfloat</code>.
940940
</p>
941941

942+
<p>
943+
The value of <code>GOMIPS64</code> environment variable (<code>hardfloat</code> or
944+
<code>softfloat</code>) is made available to assembly code by predefining either
945+
<code>GOMIPS64_hardfloat</code> or <code>GOMIPS64_softfloat</code>.
946+
</p>
947+
942948
<h3 id="unsupported_opcodes">Unsupported opcodes</h3>
943949

944950
<p>

doc/contribute.html

Lines changed: 409 additions & 280 deletions
Large diffs are not rendered by default.

doc/devel/release.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ <h3 id="go1.10.minor">Minor revisions</h3>
4141
1.10.1 milestone</a> on our issue tracker for details.
4242
</p>
4343

44+
<p>
45+
go1.10.2 (released 2018/05/01) includes fixes to the compiler, linker, and go
46+
command.
47+
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.2">Go
48+
1.10.2 milestone</a> on our issue tracker for details.
49+
</p>
50+
4451
<h2 id="go1.9">go1.9 (released 2017/08/24)</h2>
4552

4653
<p>
@@ -88,6 +95,13 @@ <h3 id="go1.9.minor">Minor revisions</h3>
8895
1.9.5 milestone</a> on our issue tracker for details.
8996
</p>
9097

98+
<p>
99+
go1.9.6 (released 2018/05/01) includes fixes to the compiler and go command.
100+
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.6">Go
101+
1.9.6 milestone</a> on our issue tracker for details.
102+
</p>
103+
104+
91105
<h2 id="go1.8">go1.8 (released 2017/02/16)</h2>
92106

93107
<p>

doc/go_faq.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,18 +1855,19 @@ <h3 id="Why_is_my_trivial_program_such_a_large_binary">
18551855

18561856
<p>
18571857
The linker in the <code>gc</code> toolchain
1858-
creates statically-linked binaries by default. All Go binaries therefore include the Go
1858+
creates statically-linked binaries by default.
1859+
All Go binaries therefore include the Go
18591860
run-time, along with the run-time type information necessary to support dynamic
18601861
type checks, reflection, and even panic-time stack traces.
18611862
</p>
18621863

18631864
<p>
1864-
A simple C "hello, world" program compiled and linked statically using gcc
1865-
on Linux is around 750 kB,
1866-
including an implementation of <code>printf</code>.
1867-
An equivalent Go program using <code>fmt.Printf</code>
1868-
is around 1.5 MB, but
1869-
that includes more powerful run-time support and type information.
1865+
A simple C "hello, world" program compiled and linked statically using
1866+
gcc on Linux is around 750 kB, including an implementation of
1867+
<code>printf</code>.
1868+
An equivalent Go program using
1869+
<code>fmt.Printf</code> weighs a couple of megabytes, but that includes
1870+
more powerful run-time support and type and debugging information.
18701871
</p>
18711872

18721873
<h3 id="unused_variables_and_imports">

doc/go_spec.html

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--{
22
"Title": "The Go Programming Language Specification",
3-
"Subtitle": "Version of February 18, 2018",
3+
"Subtitle": "Version of May 9, 2018",
44
"Path": "/ref/spec"
55
}-->
66

@@ -4160,11 +4160,6 @@ <h3 id="Constant_expressions">Constant expressions</h3>
41604160
Untyped boolean, numeric, and string constants may be used as operands
41614161
wherever it is legal to use an operand of boolean, numeric, or string type,
41624162
respectively.
4163-
Except for shift operations, if the operands of a binary operation are
4164-
different kinds of untyped constants, the operation and, for non-boolean operations, the result use
4165-
the kind that appears later in this list: integer, rune, floating-point, complex.
4166-
For example, an untyped integer constant divided by an
4167-
untyped complex constant yields an untyped complex constant.
41684163
</p>
41694164

41704165
<p>
@@ -4174,9 +4169,17 @@ <h3 id="Constant_expressions">Constant expressions</h3>
41744169
result is an integer constant; otherwise it is a constant of the same
41754170
type as the left operand, which must be of
41764171
<a href="#Numeric_types">integer type</a>.
4177-
Applying all other operators to untyped constants results in an untyped
4178-
constant of the same kind (that is, a boolean, integer, floating-point,
4179-
complex, or string constant).
4172+
</p>
4173+
4174+
<p>
4175+
Any other operation on untyped constants results in an untyped constant of the
4176+
same kind; that is, a boolean, integer, floating-point, complex, or string
4177+
constant.
4178+
If the untyped operands of a binary operation (other than a shift) are of
4179+
different kinds, the result is of the operand's kind that appears later in this
4180+
list: integer, rune, floating-point, complex.
4181+
For example, an untyped integer constant divided by an
4182+
untyped complex constant yields an untyped complex constant.
41804183
</p>
41814184

41824185
<pre>

doc/root.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<div class="left">
7575
<div id="video">
7676
<div class="rootHeading">Featured video</div>
77-
<iframe width="415" height="241" src="//www.youtube.com/embed/ytEkHepK08c" frameborder="0" allowfullscreen></iframe>
77+
<div class="js-frontpage-video" style="--aspect-ratio-padding: 58.07%;"><iframe width="415" height="241" src="//www.youtube.com/embed/ytEkHepK08c" frameborder="0" allowfullscreen></iframe></div>
7878
</div>
7979
</div>
8080

@@ -153,6 +153,10 @@
153153
];
154154
var v = videos[Math.floor(Math.random()*videos.length)];
155155
$('#video iframe').attr('height', v.h).attr('src', v.s);
156+
// Compute the aspect ratio (as a percentage) of the video
157+
// using the fixed width 415 and the height of the current video, v.h.
158+
var ar = 100*v.h/415;
159+
$('.js-frontpage-video').attr('style', '--aspect-ratio-padding: ' + ar + '%;');
156160
});
157161

158162
{{end}}

misc/android/README

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,17 @@ mobile subrepository:
88

99
To run the standard library tests, see androidtest.bash. Run it as
1010

11-
CC_FOR_TARGET=.../ndk-gcc GOARCH=arm GOARM=7 ./androidtest.bash
11+
CC_FOR_TARGET=$STANDALONE_NDK_PATH/bin/clang GOARCH=arm64 ./androidtest.bash
12+
13+
To create a standalone android NDK tool chain, follow the instructions on
14+
15+
https://developer.android.com/ndk/guides/standalone_toolchain
16+
17+
To run tests on the Android device, add the bin directory to PATH so the
18+
go tool can find the go_android_$GOARCH_exec wrapper generated by
19+
androidtest.bash. Then, use the same GOARCH as when androidtest.bash ran
20+
and set GOOS to android. For example, to run the go1 benchmarks
21+
22+
export PATH=$GOROOT/bin:$PATH
23+
cd $GOROOT/test/bench/go1/
24+
GOOS=android GOARCH=arm64 go test -bench=. -count=N -timeout=T

misc/cgo/test/cgo_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ func Test6907Go(t *testing.T) { test6907Go(t) }
8888
func Test21897(t *testing.T) { test21897(t) }
8989
func Test22906(t *testing.T) { test22906(t) }
9090
func Test24206(t *testing.T) { test24206(t) }
91+
func Test25143(t *testing.T) { test25143(t) }
9192

9293
func BenchmarkCgoCall(b *testing.B) { benchCgoCall(b) }
9394
func BenchmarkGoString(b *testing.B) { benchGoString(b) }

misc/cgo/test/issue25143.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2018 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package cgotest
6+
7+
import "C"
8+
import "testing"
9+
10+
func issue25143sum(ns ...C.int) C.int {
11+
total := C.int(0)
12+
for _, n := range ns {
13+
total += n
14+
}
15+
return total
16+
}
17+
18+
func test25143(t *testing.T) {
19+
if got, want := issue25143sum(1, 2, 3), C.int(6); got != want {
20+
t.Errorf("issue25143sum(1, 2, 3) == %v, expected %v", got, want)
21+
}
22+
}

misc/ios/README

Lines changed: 47 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,50 @@
11
Go on iOS
22
=========
33

4-
To build a cross compiling toolchain for iOS on OS X, first modify clangwrap.sh
5-
in misc/ios to match your setup. And then run:
6-
7-
GOARM=7 CGO_ENABLED=1 GOARCH=arm CC_FOR_TARGET=`pwd`/../misc/ios/clangwrap.sh \
8-
CXX_FOR_TARGET=`pwd`/../misc/ios/clangwrap.sh ./make.bash
9-
10-
To build a program, use the normal go build command:
11-
12-
CGO_ENABLED=1 GOARCH=arm go build import/path
13-
14-
To run a program on an iDevice, first make sure you have a valid developer
15-
certificate and have setup your iDevice properly to run apps signed by your
16-
developer certificate. Then install https://github.com/phonegap/ios-deploy.
17-
At a first step, you can try building the famous hello world program to run
18-
on your test device.
19-
(The needed files are provided at https://github.com/minux/go-ios-examples.)
20-
21-
# assume your program binary is helloworld.go, build it into the
22-
# example hello.app bundle.
23-
CGO_ENABLED=1 GOARCH=arm go build -o hello.app/hello helloworld.go
24-
# sign the executable using your developer certificate
25-
codesign -f -s "iPhone Developer" --entitlements hello.app/Entitlements.plist hello.app/hello
26-
# run the program inside lldb on iDevice, run `ios-deploy` for more
27-
# command options
28-
ios-deploy --debug --uninstall --bundle hello.app
29-
# Depending on your ios-deploy version, you might need to enter "run"
30-
# into lldb to run your program, and its output will be shown by lldb.
31-
32-
Notes:
33-
- A dummy hello.app bundle is provided in this directory to help you get started.
34-
- Running the program on an iDevice requires code sign and thus external linking,
35-
if your program uses cgo, then it will automatically use external linking.
36-
However, if your program does not use cgo, please make sure to add
37-
import _ "runtime/cgo"
38-
so that external linking will be used.
39-
40-
Known issues
41-
============
42-
- crypto/x509 won't build, I don't yet know how to get system root on iOS.
43-
- Because I still want to be able to do native build, CGO_ENABLED=1 is not the
44-
default, yet.
4+
For details on developing Go for iOS on macOS, see the documentation in the mobile
5+
subrepository:
6+
7+
https://github.com/golang/mobile
8+
9+
It is necessary to set up the environment before running tests or programs directly on a
10+
device.
11+
12+
First make sure you have a valid developer certificate and have setup your device properly
13+
to run apps signed by your developer certificate. Then install the libimobiledevice and
14+
ideviceinstaller tools from https://www.libimobiledevice.org/. Use the HEAD versions from
15+
source; the stable versions have bugs that prevents the Go exec wrapper to install and run
16+
apps.
17+
18+
Second, the Go exec wrapper must be told the developer account signing identity, the team
19+
id and a provisioned bundle id to use. They're specified with the environment variables
20+
GOIOS_DEV_ID, GOIOS_TEAM_ID and GOIOS_APP_ID. The detect.go program in this directory will
21+
attempt to auto-detect suitable values. Run it as
22+
23+
go run detect.go
24+
25+
which will output something similar to
26+
27+
export GOIOS_DEV_ID="iPhone Developer: [email protected] (XXXXXXXX)"
28+
export GOIOS_APP_ID=YYYYYYYY.some.bundle.id
29+
export GOIOS_TEAM_ID=ZZZZZZZZ
30+
31+
If you have multiple devices connected, specify the device UDID with the GOIOS_DEVICE_ID
32+
variable. Use `idevice_id -l` to list all available UDIDs.
33+
34+
Finally, to run the standard library tests, run iostest.bash with GOARCH set. For example,
35+
36+
GOARCH=arm64 ./iostest.bash
37+
38+
To use the go tool directly to run programs and tests, put $GOROOT/bin into PATH to ensure
39+
the go_darwin_$GOARCH_exec wrapper is found. For example, to run the archive/tar tests
40+
41+
export PATH=$GOROOT/bin:$PATH
42+
GOARCH=arm64 go test archive/tar
43+
44+
Note that the go_darwin_$GOARCH_exec wrapper uninstalls any existing app identified by
45+
the bundle id before installing a new app. If the uninstalled app is the last app by
46+
the developer identity, the device might also remove the permission to run apps from
47+
that developer, and the exec wrapper will fail to install the new app. To avoid that,
48+
install another app with the same developer identity but with a different bundle id.
49+
That way, the permission to install apps is held on to while the primary app is
50+
uninstalled.

0 commit comments

Comments
 (0)