summaryrefslogtreecommitdiff
path: root/src/pkg/encoding/gob
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/encoding/gob')
-rw-r--r--src/pkg/encoding/gob/codec_test.go6
-rw-r--r--src/pkg/encoding/gob/decode.go1
-rw-r--r--src/pkg/encoding/gob/timing_test.go9
-rw-r--r--src/pkg/encoding/gob/type.go1
4 files changed, 11 insertions, 6 deletions
diff --git a/src/pkg/encoding/gob/codec_test.go b/src/pkg/encoding/gob/codec_test.go
index 482212b74..9e38e31d5 100644
--- a/src/pkg/encoding/gob/codec_test.go
+++ b/src/pkg/encoding/gob/codec_test.go
@@ -1191,10 +1191,8 @@ func TestInterface(t *testing.T) {
if v1 != nil || v2 != nil {
t.Errorf("item %d inconsistent nils", i)
}
- continue
- if v1.Square() != v2.Square() {
- t.Errorf("item %d inconsistent values: %v %v", i, v1, v2)
- }
+ } else if v1.Square() != v2.Square() {
+ t.Errorf("item %d inconsistent values: %v %v", i, v1, v2)
}
}
}
diff --git a/src/pkg/encoding/gob/decode.go b/src/pkg/encoding/gob/decode.go
index a80d9f919..7cc756540 100644
--- a/src/pkg/encoding/gob/decode.go
+++ b/src/pkg/encoding/gob/decode.go
@@ -1066,7 +1066,6 @@ func (dec *Decoder) compatibleType(fr reflect.Type, fw typeId, inProgress map[re
case reflect.Struct:
return true
}
- return true
}
// typeString returns a human-readable description of the type identified by remoteId.
diff --git a/src/pkg/encoding/gob/timing_test.go b/src/pkg/encoding/gob/timing_test.go
index 13eb11925..f589675dd 100644
--- a/src/pkg/encoding/gob/timing_test.go
+++ b/src/pkg/encoding/gob/timing_test.go
@@ -9,6 +9,7 @@ import (
"fmt"
"io"
"os"
+ "runtime"
"testing"
)
@@ -49,6 +50,10 @@ func BenchmarkEndToEndByteBuffer(b *testing.B) {
}
func TestCountEncodeMallocs(t *testing.T) {
+ if runtime.GOMAXPROCS(0) > 1 {
+ t.Skip("skipping; GOMAXPROCS>1")
+ }
+
const N = 1000
var buf bytes.Buffer
@@ -65,6 +70,10 @@ func TestCountEncodeMallocs(t *testing.T) {
}
func TestCountDecodeMallocs(t *testing.T) {
+ if runtime.GOMAXPROCS(0) > 1 {
+ t.Skip("skipping; GOMAXPROCS>1")
+ }
+
const N = 1000
var buf bytes.Buffer
diff --git a/src/pkg/encoding/gob/type.go b/src/pkg/encoding/gob/type.go
index ea0db4eac..7fa0b499f 100644
--- a/src/pkg/encoding/gob/type.go
+++ b/src/pkg/encoding/gob/type.go
@@ -526,7 +526,6 @@ func newTypeObject(name string, ut *userTypeInfo, rt reflect.Type) (gobType, err
default:
return nil, errors.New("gob NewTypeObject can't handle type: " + rt.String())
}
- return nil, nil
}
// isExported reports whether this is an exported - upper case - name.