code: func (rc *refCounter) GetReference(fileName string, openRefFile func(fileName string, exists bool) (*os.File, error)) (*os.File, error) {
  	rc.mu.Lock()
  	defer rc.mu.Unlock()
  
  	var (
  		file *os.File
  		err  error
  	)
  	_, ok := rc.counter[fileName]
  	file, err = openRefFile(fileName, ok)
  	if err != nil {
  		return nil, err
  	}
  
  	if ok {
  		rc.counter[fileName]++
  	} else if file != nil {
  		rc.counter[file.Name()] = 1
  	}
  
  	return file, nil
  }
docs: // Reference increase the reference counter for specified logfile