code: func (l *DiagnosticLog) Copy(ctx context.Context, w io.Writer) (int, error) {
  	const max = 500 // VC max == 500, ESX max == 1000
  	written := 0
  
  	for {
  		h, err := l.m.BrowseLog(ctx, l.Host, l.Key, l.Start, max)
  		if err != nil {
  			return 0, err
  		}
  
  		for _, line := range h.LineText {
  			n, err := fmt.Fprintln(w, line)
  			written += n
  			if err != nil {
  				return written, err
  			}
  		}
  
  		l.Start += int32(len(h.LineText))
  
  		if l.Start >= h.LineEnd {
  			break
  		}
  	}
  
  	return written, nil
  }
docs: // Copy log starting from l.Start to the given io.Writer
  // Returns on error or when end of log is reached.