code: func NewSyncWriter(w io.Writer) *SyncWriter {
  	sw := &SyncWriter{
  		w: w,
  	}
  
  	if sync, ok := w.(interface {
  		Sync() error
  	}); ok {
  		sw.syncFn = sync.Sync
  	} else {
  		sw.syncFn = func() error { return nil }
  	}
  
  	if close, ok := w.(io.Closer); ok {
  		sw.closeFn = close.Close
  	} else {
  		sw.closeFn = func() error { return nil }
  	}
  
  	return sw
  }
docs: // NewSyncWriter returns a new instance of the *SyncWriter that sends all writes
  // to the given io.Writer.