code: func (s *SpanModel) UnmarshalJSON(b []byte) error {
  	type Alias SpanModel
  	span := &struct {
  		T uint64 `json:"timestamp,omitempty"`
  		D uint64 `json:"duration,omitempty"`
  		*Alias
  	}{
  		Alias: (*Alias)(s),
  	}
  	if err := json.Unmarshal(b, &span); err != nil {
  		return err
  	}
  	if s.ID < 1 {
  		return ErrValidIDRequired
  	}
  	if span.T > 0 {
  		s.Timestamp = time.Unix(0, int64(span.T)*1e3)
  	}
  	s.Duration = time.Duration(span.D*1e3) * time.Nanosecond
  	if s.LocalEndpoint.Empty() {
  		s.LocalEndpoint = nil
  	}
  
  	if s.RemoteEndpoint.Empty() {
  		s.RemoteEndpoint = nil
  	}
  	return nil
  }
docs: // UnmarshalJSON imports our Model from a Zipkin V2 API compatible span
  // representation.