Skip to content

fix: declare err variable inline for startDirWatcher call#237

Merged
johnlanni merged 1 commit into
mainfrom
fix/file-rest-err-variable
Feb 1, 2026
Merged

fix: declare err variable inline for startDirWatcher call#237
johnlanni merged 1 commit into
mainfrom
fix/file-rest-err-variable

Conversation

@johnlanni
Copy link
Copy Markdown
Contributor

Problem

After PR #236 was merged, compilation fails with:

pkg/registry/file_rest.go:81:2: undefined: err
pkg/registry/file_rest.go:82:5: undefined: err
pkg/registry/file_rest.go:83:15: undefined: err

Root Cause

PR #236 removed the watcher, err := fsnotify.NewWatcher() lines but the code still references the err variable on the next lines.

Solution

Change:

err = f.startDirWatcher()
if err != nil {
    return nil, err
}

To:

if err := f.startDirWatcher(); err != nil {
    return nil, err
}

This declares err inline, fixing the undefined variable error.

Testing

Compilation now succeeds.

@johnlanni johnlanni requested a review from CH3CHO as a code owner February 1, 2026 14:51
@lingma-agents
Copy link
Copy Markdown

lingma-agents Bot commented Feb 1, 2026

🔍 代码审查进行中

⏳ 正在审查

⏰️ 剩余时间:约需数分钟

🔄 分支流向: fix/file-rest-err-variablemain

📦 提交: 审查当前PR从7948cb4c56a642的提交。


📒 文件清单 (1 个文件)
📝 变更: 1 个文件

📝 变更文件:

  • src/apiserver/pkg/registry/file_rest.go

@johnlanni johnlanni merged commit af3fe31 into main Feb 1, 2026
3 of 4 checks passed
@lingma-agents
Copy link
Copy Markdown

lingma-agents Bot commented Feb 1, 2026

CodeReview流程已终止

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant