From a2ac2e0b221e4c371bde5d11a075c8f0d28f7d77 Mon Sep 17 00:00:00 2001 From: Ran <8403607+eddieran@users.noreply.github.com> Date: Wed, 6 May 2026 10:33:04 +0800 Subject: [PATCH] fix(agent/file): correct return type of NewIFileService (#12648) `NewIFileService` returns the bare struct type `FileService`, but its body returns a pointer (`&FileService{}`), and the function name suggests it should return the interface (`IFileService`). The current signature breaks `go build ./...` on the `agent` module: app/service/file.go:95:9: cannot use &FileService{} (value of type *FileService) as FileService value in return statement app/service/website_proxy.go:276:36: cannot call pointer method GetFileList on FileService Both errors resolve when the constructor returns the interface, since `*FileService` implements every method on `IFileService` (verified with `go vet ./...`). After this change, `go build ./...` and `go vet ./...` are clean on the `agent` module. --- agent/app/service/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/app/service/file.go b/agent/app/service/file.go index ec1700c55..73c2c3d23 100644 --- a/agent/app/service/file.go +++ b/agent/app/service/file.go @@ -91,7 +91,7 @@ const ( fileRemarkEncodedMaxLen = 256 ) -func NewIFileService() FileService { +func NewIFileService() IFileService { return &FileService{} }