func (m *Duration) Marshal() []byte {
	writer := jspb.NewWriter()
	m.MarshalToWriter(writer)
	return writer.GetResult()
}
Marshal marshals Duration to a slice of bytes.
package duration
import jspb "github.com/johanbrandhorst/protobuf/jspb"
const _ = jspb.JspbPackageIsVersion2
type Duration struct {
	Seconds int64
	Nanos int32
}
func (m *Duration) GetSeconds() (x int64) {
	if m == nil {
		return x
	}
	return m.Seconds
}
func (m *Duration) GetNanos() (x int32) {
	if m == nil {
		return x
	}
	return m.Nanos
}
func (m *Duration) MarshalToWriter(writer jspb.Writer) {
	if m == nil {
		return
	}
	if m.Seconds != 0 {
		writer.WriteInt64(1, m.Seconds)
	}
	if m.Nanos != 0 {
		writer.WriteInt32(2, m.Nanos)
	}
	return
}