diff options
Diffstat (limited to 'src/encoding')
| -rw-r--r-- | src/encoding/asn1/marshal.go | 6 | ||||
| -rw-r--r-- | src/encoding/binary/binary.go | 2 | ||||
| -rw-r--r-- | src/encoding/gob/encode.go | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/encoding/asn1/marshal.go b/src/encoding/asn1/marshal.go index 2b796c4e75..30797ef099 100644 --- a/src/encoding/asn1/marshal.go +++ b/src/encoding/asn1/marshal.go @@ -315,9 +315,9 @@ func marshalUTCTime(out *forkableWriter, t time.Time) (err error) { switch { case 1950 <= year && year < 2000: - err = marshalTwoDigits(out, int(year-1900)) + err = marshalTwoDigits(out, year-1900) case 2000 <= year && year < 2050: - err = marshalTwoDigits(out, int(year-2000)) + err = marshalTwoDigits(out, year-2000) default: return StructuralError{"cannot represent time as UTCTime"} } @@ -435,7 +435,7 @@ func marshalBody(out *forkableWriter, value reflect.Value, params fieldParameter return out.WriteByte(0) } case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return marshalInt64(out, int64(v.Int())) + return marshalInt64(out, v.Int()) case reflect.Struct: t := v.Type() diff --git a/src/encoding/binary/binary.go b/src/encoding/binary/binary.go index ada5768695..46c6add062 100644 --- a/src/encoding/binary/binary.go +++ b/src/encoding/binary/binary.go @@ -269,7 +269,7 @@ func Write(w io.Writer, order ByteOrder, data interface{}) error { case *uint8: b[0] = *v case uint8: - b[0] = byte(v) + b[0] = v case []uint8: bs = v case *int16: diff --git a/src/encoding/gob/encode.go b/src/encoding/gob/encode.go index 2b3a556eac..50cd6adb46 100644 --- a/src/encoding/gob/encode.go +++ b/src/encoding/gob/encode.go @@ -127,7 +127,7 @@ func (state *encoderState) encodeInt(i int64) { } else { x = uint64(i << 1) } - state.encodeUint(uint64(x)) + state.encodeUint(x) } // encOp is the signature of an encoding operator for a given type. |
