-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Description
Before filing a bug, please check whether it has been fixed since the latest release: run "hg pull -u" and retry what you did to reproduce the problem. Thanks. What steps will reproduce the problem? 1. package main import ( "fmt" "asn1" "encoding/hex" ) func main() { buf, _ := asn1.MarshalToMemory(-128) fmt.Println(hex.EncodeToString(buf)) buf, _ = asn1.MarshalToMemory(128) fmt.Println(hex.EncodeToString(buf)) var x int asn1.Unmarshal(&x, buf) fmt.Println(x) } What is the expected output? 020180 02020080 128 What do you see instead? 0200 020180 -128 What is your $GOOS? $GOARCH? linux 386 Which revision are you using? (hg identify) 8c17e4da43c1+ tip Please provide any additional information below.