Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go1.11.1 updates tracking #1

Merged
merged 13 commits into from
Oct 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
go1.11
go1.11.1
1 change: 1 addition & 0 deletions doc/contrib.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ <h3 id="release"><a href="/doc/devel/release.html">Release History</a></h3>
<p>A <a href="/doc/devel/release.html">summary</a> of the changes between Go releases. Notes for the major releases:</p>

<ul>
<li><a href="/doc/go1.11">Go 1.11</a> <small>(August 2018)</small></li>
<li><a href="/doc/go1.10">Go 1.10</a> <small>(February 2018)</small></li>
<li><a href="/doc/go1.9">Go 1.9</a> <small>(August 2017)</small></li>
<li><a href="/doc/go1.8">Go 1.8</a> <small>(February 2017)</small></li>
Expand Down
11 changes: 11 additions & 0 deletions doc/devel/release.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ <h2 id="go1.11">go1.11 (released 2018/08/24)</h2>
Read the <a href="/doc/go1.11">Go 1.11 Release Notes</a> for more information.
</p>

<h3 id="go1.11.minor">Minor revisions</h3>

<p>
go1.11.1 (released 2018/10/01) includes fixes to the compiler, documentation, go
command, runtime, and the <code>crypto/x509</code>, <code>encoding/json</code>,
<code>go/types</code>, <code>net</code>, <code>net/http</code>, and
<code>reflect</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.1">Go
1.11.1 milestone</a> on our issue tracker for details.
</p>

<h2 id="go1.10">go1.10 (released 2018/02/16)</h2>

<p>
Expand Down
14 changes: 14 additions & 0 deletions doc/go1.11.html
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,20 @@ <h3 id="cgo">Cgo</h3>
details. <!-- CL 126275, CL 127156, CL 122217, CL 122575, CL 123177 -->
</p>

<h3 id="go_command">Go command</h3>

<p><!-- CL 126656 -->
The environment variable <code>GOFLAGS</code> may now be used
to set default flags for the <code>go</code> command.
This is useful in certain situations.
Linking can be noticeably slower on underpowered systems due to DWARF,
and users may want to set <code>-ldflags=-w</code> by default.
For modules, some users and CI systems will want vendoring always,
so they should set <code>-mod=vendor</code> by default.
For more information, see the <a href="/cmd/go/#hdr-Environment_variables"><code>go</code>
command documentation</a>.
</p>

<h3 id="godoc">Godoc</h3>

<p>
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/types/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ func (t *Type) ChanArgs() *Type {
return t.Extra.(ChanArgs).T
}

// FuncArgs returns the channel type for TFUNCARGS type t.
// FuncArgs returns the func type for TFUNCARGS type t.
func (t *Type) FuncArgs() *Type {
t.wantEtype(TFUNCARGS)
return t.Extra.(FuncArgs).T
Expand Down
6 changes: 6 additions & 0 deletions src/cmd/go/alldocs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/cmd/go/internal/help/helpdoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,12 @@ General-purpose environment variables:
The directory where the go command will write
temporary source files, packages, and binaries.

Each entry in the GOFLAGS list must be a standalone flag.
Because the entries are space-separated, flag values must
not contain spaces. In some cases, you can provide multiple flag
values instead: for example, to set '-ldflags=-s -w'
you can use 'GOFLAGS=-ldflags=-s -ldflags=-w'.

Environment variables for use with cgo:

CC
Expand Down
4 changes: 3 additions & 1 deletion src/cmd/go/internal/work/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
if len(p.SFiles) > 0 {
fmt.Fprintf(h, "asm %q %q %q\n", b.toolID("asm"), forcedAsmflags, p.Internal.Asmflags)
}
fmt.Fprintf(h, "GO$GOARCH=%s\n", os.Getenv("GO"+strings.ToUpper(cfg.BuildContext.GOARCH))) // GO386, GOARM, etc
// GO386, GOARM, GOMIPS, etc.
baseArch := strings.TrimSuffix(cfg.BuildContext.GOARCH, "le")
fmt.Fprintf(h, "GO$GOARCH=%s\n", os.Getenv("GO"+strings.ToUpper(baseArch)))

// TODO(rsc): Convince compiler team not to add more magic environment variables,
// or perhaps restrict the environment variables passed to subprocesses.
Expand Down
37 changes: 37 additions & 0 deletions src/cmd/go/testdata/script/build_cache_gomips.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Set up fresh GOCACHE.
env GOCACHE=$WORK/gocache
mkdir $GOCACHE

# Building for mipsle without setting GOMIPS will use floating point registers.
env GOARCH=mipsle
env GOOS=linux
go build -gcflags=-S f.go
stderr ADDD.F[0-9]+,.F[0-9]+,.F[0-9]+

# Clean cache
go clean -cache

# Building with GOMIPS=softfloat will not use floating point registers
env GOMIPS=softfloat
go build -gcflags=-S f.go
! stderr ADDD.F[0-9]+,.F[0-9]+,.F[0-9]+

# Clean cache
go clean -cache

# Build without setting GOMIPS
env GOMIPS=
go build -gcflags=-S f.go
stderr ADDD.F[0-9]+,.F[0-9]+,.F[0-9]+

# Building with GOMIPS should still not use floating point registers.
env GOMIPS=softfloat
go build -gcflags=-S f.go
! stderr ADDD.F[0-9]+,.F[0-9]+,.F[0-9]+

-- f.go --
package f

func F(x float64) float64 {
return x + x
}
6 changes: 3 additions & 3 deletions src/encoding/json/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ func (d *decodeState) object(v reflect.Value) error {
}

var mapElem reflect.Value
originalErrorContext := d.errorContext

for {
// Read opening " of string key or closing }.
Expand Down Expand Up @@ -832,8 +833,7 @@ func (d *decodeState) object(v reflect.Value) error {
return errPhase
}

d.errorContext.Struct = ""
d.errorContext.Field = ""
d.errorContext = originalErrorContext
}
return nil
}
Expand Down Expand Up @@ -991,7 +991,7 @@ func (d *decodeState) literalStore(item []byte, v reflect.Value, fromQuoted bool
if fromQuoted {
return fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())
}
return &UnmarshalTypeError{Value: "number", Type: v.Type(), Offset: int64(d.readIndex())}
d.saveError(&UnmarshalTypeError{Value: "number", Type: v.Type(), Offset: int64(d.readIndex())})
case reflect.Interface:
n, err := d.convertNumber(s)
if err != nil {
Expand Down
17 changes: 17 additions & 0 deletions src/encoding/json/decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@ func (b *intWithPtrMarshalText) UnmarshalText(data []byte) error {
return (*intWithMarshalText)(b).UnmarshalText(data)
}

type mapStringToStringData struct {
Data map[string]string `json:"data"`
}

type unmarshalTest struct {
in string
ptr interface{}
Expand Down Expand Up @@ -401,6 +405,7 @@ var unmarshalTests = []unmarshalTest{
{in: `"invalid: \uD834x\uDD1E"`, ptr: new(string), out: "invalid: \uFFFDx\uFFFD"},
{in: "null", ptr: new(interface{}), out: nil},
{in: `{"X": [1,2,3], "Y": 4}`, ptr: new(T), out: T{Y: 4}, err: &UnmarshalTypeError{"array", reflect.TypeOf(""), 7, "T", "X"}},
{in: `{"X": 23}`, ptr: new(T), out: T{}, err: &UnmarshalTypeError{"number", reflect.TypeOf(""), 8, "T", "X"}}, {in: `{"x": 1}`, ptr: new(tx), out: tx{}},
{in: `{"x": 1}`, ptr: new(tx), out: tx{}},
{in: `{"x": 1}`, ptr: new(tx), err: fmt.Errorf("json: unknown field \"x\""), disallowUnknownFields: true},
{in: `{"F1":1,"F2":2,"F3":3}`, ptr: new(V), out: V{F1: float64(1), F2: int32(2), F3: Number("3")}},
Expand Down Expand Up @@ -866,6 +871,18 @@ var unmarshalTests = []unmarshalTest{
err: fmt.Errorf("json: unknown field \"extra\""),
disallowUnknownFields: true,
},
// issue 26444
// UnmarshalTypeError without field & struct values
{
in: `{"data":{"test1": "bob", "test2": 123}}`,
ptr: new(mapStringToStringData),
err: &UnmarshalTypeError{Value: "number", Type: reflect.TypeOf(""), Offset: 37, Struct: "mapStringToStringData", Field: "data"},
},
{
in: `{"data":{"test1": 123, "test2": "bob"}}`,
ptr: new(mapStringToStringData),
err: &UnmarshalTypeError{Value: "number", Type: reflect.TypeOf(""), Offset: 21, Struct: "mapStringToStringData", Field: "data"},
},
}

func TestMarshal(t *testing.T) {
Expand Down
Loading