return marshalField(out, v.Elem(), params)
}
+ if params.optional && reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface()) {
+ return
+ }
+
if v.Type() == rawValueType {
rv := v.Interface().(RawValue)
- if rv.Class == 0 && rv.Tag == 0 && len(rv.Bytes) == 0 && params.optional {
- return
- }
err = marshalTagAndLength(out, tagAndLength{rv.Class, rv.Tag, len(rv.Bytes), rv.IsCompound})
if err != nil {
return
return
}
- if params.optional && reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface()) {
- return
- }
-
tag, isCompound, ok := getUniversalType(v.Type())
if !ok {
err = StructuralError{fmt.Sprintf("unknown Go type: %v", v.Type())}
A string "printable"
}
+type optionalRawValueTest struct {
+ A RawValue "optional"
+}
+
type testSET []int
func setPST(t *time.Time) *time.Time {
"7878787878787878787878787878787878787878787878787878787878787878",
},
{ia5StringTest{"test"}, "3006160474657374"},
+ {optionalRawValueTest{}, "3000"},
{printableStringTest{"test"}, "3006130474657374"},
{printableStringTest{"test*"}, "30071305746573742a"},
{rawContentsStruct{nil, 64}, "3003020140"},