code: func (s *SourceSpec) IsRegularSourceFile(filename string) (bool, error) {
  	fi, err := helpers.LstatIfPossible(s.SourceFs, filename)
  	if err != nil {
  		return false, err
  	}
  
  	if fi.IsDir() {
  		return false, nil
  	}
  
  	if fi.Mode()&os.ModeSymlink == os.ModeSymlink {
  		link, err := filepath.EvalSymlinks(filename)
  		if err != nil {
  			return false, err
  		}
  
  		fi, err = helpers.LstatIfPossible(s.SourceFs, link)
  		if err != nil {
  			return false, err
  		}
  
  		if fi.IsDir() {
  			return false, nil
  		}
  	}
  
  	return true, nil
  }
docs: // IsRegularSourceFile returns whether filename represents a regular file in the
  // source filesystem.