Skip to content

Commit

Permalink
go sdk: Fix compile warnings (#7619)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Luzzardi <[email protected]>
  • Loading branch information
aluzzardi authored Jun 11, 2024
1 parent e82f931 commit c7e3fd8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion cmd/codegen/generator/go/templates/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,11 @@ func invokeSrc(objFunctionCases map[string][]Code, createMod Code) string {
Id("_").Id("any"),
// err error)
Id("err").Error(),
).Block(objSwitch)
).Block(
// suppress warning if `inputArgs` is unused
Id("_").Op("=").Id(inputArgsVar),
objSwitch,
)

return fmt.Sprintf("%#v", invokeFunc)
}
Expand Down
4 changes: 3 additions & 1 deletion sdk/go/querybuilder/querybuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ func (s *Selection) unpack(data interface{}) error {
if err != nil {
return err
}
json.Unmarshal(marshalled, s.bind)
if err := json.Unmarshal(marshalled, s.bind); err != nil {
return err
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/go/telemetry/exporters.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (m LogForwarder) Export(ctx context.Context, logs []sdklog.Record) error {
e := e
eg.Go(func() error {
for _, log := range logs {
e.OnEmit(ctx, log)
_ = e.OnEmit(ctx, log)
}
return nil
})
Expand Down

0 comments on commit c7e3fd8

Please sign in to comment.