code: func (s *Storage) sftp() (*sftp.Client, error) {
  	s.mu.Lock()
  	if s.sc != nil {
  		defer s.mu.Unlock()
  		// TODO: remove all this "lastGet" stuff once the wait
  		// mechanism has test coverage and we're sending
  		// periodic heartbeats over the SSH channel.
  		if now := time.Now(); s.lastGet.After(now.Add(-30 * time.Second)) {
  			s.lastGet = now
  			return s.sc, nil
  		} else {
  			// It's been awhile. Let's see if it's still good.
  			_, err := s.sc.Stat(".")
  			if err != nil {
  				s.markConnDeadLocked()
  			} else {
  				s.lastGet = now
  				return s.sc, nil
  			}
  		}
  	}
  	s.mu.Unlock()
  	ci, err := s.getClientGroup.Do("", func() (interface{}, error) {
  		sc, waiter, toClose, err := s.dialSFTP()
  		if err != nil {
  			return nil, err
  		}
  		if waiter != nil {
  			go s.monitorSSHConn(waiter)
  		}
  		s.mu.Lock()
  		defer s.mu.Unlock()
  		s.connCloser = toClose
  		s.sc = sc
  		s.lastGet = time.Now()
  		return sc, nil
  	})
  	if err != nil {
  		return nil, err
  	}
  	return ci.(*sftp.Client), nil
  }
docs: // sftp returns the *sftp.Client to the server, handling reconnects and coalesced dialing
  // for concurrent callers.