Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/go_emit.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/go_emit.iced
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ exports.GoEmitter = class GoEmitter extends BaseEmitter

emit_server_hook_make_arg : ({name, details}) ->
arg = details.request
@output "MakeArg: func() interface{} {"
@output "MakeArg: func() any {"
@tab()

# Over the wire, we're expecting either an empty argument array,
Expand All @@ -665,7 +665,7 @@ exports.GoEmitter = class GoEmitter extends BaseEmitter
res = details.response
resvar = if res? then "ret, " else ""
pt = @go_primitive_type arg.type
@output "Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {"
@output "Handler: func(ctx context.Context, args any) (ret any, err error) {"
@tab()
if arg.nargs > 0
@output "typedArgs, ok := args.(*[1]#{pt})"
Expand Down Expand Up @@ -735,7 +735,7 @@ exports.GoEmitter = class GoEmitter extends BaseEmitter
if arg.nargs is 1
n = arg.single.name
@output "#{arg.name} := #{arg.type}{ #{@go_export_case n} : #{n} }"
oarg = "[]interface{}{"
oarg = "[]any{"
oarg += if arg.nargs is 0 then "#{arg.type}{}"
else arg.name
oarg += "}"
Expand Down
18 changes: 9 additions & 9 deletions test/files/sample.go
Original file line number Diff line number Diff line change
Expand Up @@ -983,11 +983,11 @@ func SampleProtocol(i SampleInterface) rpc.Protocol {
Name: "sample.1.sample",
Methods: map[string]rpc.ServeHandlerDescription{
"getBaz": {
MakeArg: func() interface{} {
MakeArg: func() any {
var ret [1]GetBazArg
return &ret
},
Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
Handler: func(ctx context.Context, args any) (ret any, err error) {
typedArgs, ok := args.(*[1]GetBazArg)
if !ok {
err = rpc.NewTypeError((*[1]GetBazArg)(nil), args)
Expand All @@ -998,11 +998,11 @@ func SampleProtocol(i SampleInterface) rpc.Protocol {
},
},
"notifier": {
MakeArg: func() interface{} {
MakeArg: func() any {
var ret [1]NotifierArg
return &ret
},
Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
Handler: func(ctx context.Context, args any) (ret any, err error) {
typedArgs, ok := args.(*[1]NotifierArg)
if !ok {
err = rpc.NewTypeError((*[1]NotifierArg)(nil), args)
Expand All @@ -1013,11 +1013,11 @@ func SampleProtocol(i SampleInterface) rpc.Protocol {
},
},
"processBigBytes": {
MakeArg: func() interface{} {
MakeArg: func() any {
var ret [1]ProcessBigBytesArg
return &ret
},
Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
Handler: func(ctx context.Context, args any) (ret any, err error) {
typedArgs, ok := args.(*[1]ProcessBigBytesArg)
if !ok {
err = rpc.NewTypeError((*[1]ProcessBigBytesArg)(nil), args)
Expand All @@ -1040,20 +1040,20 @@ type SampleClient struct {
//
// And then.
func (c SampleClient) GetBaz(ctx context.Context, __arg GetBazArg) (res keybase1.SigID, err error) {
err = c.Cli.CallCompressed(ctx, "sample.1.sample.getBaz", []interface{}{__arg}, &res, rpc.CompressionGzip, 0*time.Millisecond)
err = c.Cli.CallCompressed(ctx, "sample.1.sample.getBaz", []any{__arg}, &res, rpc.CompressionGzip, 0*time.Millisecond)
return
}

// Notifier notifies the notifiee.
func (c SampleClient) Notifier(ctx context.Context, i int) (err error) {
__arg := NotifierArg{I: i}
err = c.Cli.Notify(ctx, "sample.1.sample.notifier", []interface{}{__arg}, 0*time.Millisecond)
err = c.Cli.Notify(ctx, "sample.1.sample.notifier", []any{__arg}, 0*time.Millisecond)
return
}

// ProcessBigBytes will try to process a bunch of bytes.
func (c SampleClient) ProcessBigBytes(ctx context.Context, bytes BigBytes) (err error) {
__arg := ProcessBigBytesArg{Bytes: bytes}
err = c.Cli.Call(ctx, "sample.1.sample.processBigBytes", []interface{}{__arg}, nil, 1000*time.Millisecond)
err = c.Cli.Call(ctx, "sample.1.sample.processBigBytes", []any{__arg}, nil, 1000*time.Millisecond)
return
}
Loading