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.
This commit is contained in:
Ran
2026-05-06 10:33:04 +08:00
committed by GitHub
parent a5a5d9f1ac
commit a2ac2e0b22
+1 -1
View File
@@ -91,7 +91,7 @@ const (
fileRemarkEncodedMaxLen = 256
)
func NewIFileService() FileService {
func NewIFileService() IFileService {
return &FileService{}
}