diff --git a/codegen/header_propagate.go b/codegen/header_propagate.go index 05ca1dd71..9a89004a8 100644 --- a/codegen/header_propagate.go +++ b/codegen/header_propagate.go @@ -100,7 +100,7 @@ func typeSwitch(key, gotype string, field *compile.FieldSpec) []string { assignVal = "v" case "int16": typeParse = "strconv.ParseInt(key, 10, 16)" - assignVal = "v" + assignVal = "val" typeCast = "val := int16(v)\n" case "int32": typeParse = "strconv.ParseInt(key, 10, 32)" diff --git a/codegen/header_propagate_test.go b/codegen/header_propagate_test.go index 6af4a4c97..86b79341d 100644 --- a/codegen/header_propagate_test.go +++ b/codegen/header_propagate_test.go @@ -403,13 +403,13 @@ func TestPrimaryType(t *testing.T) { if key, ok := headers.Get("x-int"); ok { if v, err := strconv.ParseInt(key,10,16); err == nil { val:=int16(v) - in.I5=v + in.I5=val } } if key, ok := headers.Get("x-int"); ok { if v, err := strconv.ParseInt(key,10,16); err == nil { val:=int16(v) - in.I6=&v + in.I6=&val } } if key, ok := headers.Get("x-string"); ok {