Skip to content

Commit d8f3b32

Browse files
committed
Fix StreamCancelFn type definition
StreamCancelFn was incorrectly defined as func() but is actually used as func(context.Context) error throughout the codebase. This caused build failures in multiple places: - wshclientutil.go:66: cannot use func(ctx context.Context) error as func() value - web.go:255: cannot use func() as func(context.Context) error value Fixed by correcting the type definition in wshrpctypes.go to match actual usage. Fixes build errors introduced in #2709
1 parent 90011a7 commit d8f3b32

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

pkg/wshrpc/wshclient/wshclientutil.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ func sendRpcRequestResponseStreamHelper[T any](w *wshutil.WshRpc, command string
6363
rtnErr(respChan, err)
6464
return respChan
6565
}
66-
opts.StreamCancelFn = func(ctx context.Context) error {
67-
return reqHandler.SendCancel(ctx)
66+
opts.StreamCancelFn = func() {
67+
reqHandler.SendCancel(context.Background())
6868
}
6969
go func() {
7070
defer func() {

pkg/wshrpc/wshrpctypes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ type RpcOpts struct {
373373
NoResponse bool `json:"noresponse,omitempty"`
374374
Route string `json:"route,omitempty"`
375375

376-
StreamCancelFn func() `json:"-"` // this is an *output* parameter, set by the handler
376+
StreamCancelFn func(context.Context) error `json:"-"` // this is an *output* parameter, set by the handler
377377
}
378378

379379
const (

0 commit comments

Comments
 (0)