Skip to content

Commit

Permalink
fix(wit-bindgen-go): Add missing 'instance' key to slog statements
Browse files Browse the repository at this point in the history
Signed-off-by: Joonas Bergius <[email protected]>
  • Loading branch information
joonas authored and rvolosatovs committed Sep 13, 2024
1 parent ffdad46 commit 67fc056
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/wit-bindgen-go/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2555,7 +2555,7 @@ func ServeInterface(s {wrpc}.Server, h Handler) (stop func() error, err error) {
self.src,
r#"
if err != nil {{
{slog}.WarnContext(ctx, "failed to write result value", "i", {i}, "{instance}", "name", "{name}", "err", err)
{slog}.WarnContext(ctx, "failed to write result value", "i", {i}, "instance", "{instance}", "name", "{name}", "err", err)
return
}}
if write{i} != nil {{
Expand All @@ -2569,21 +2569,21 @@ func ServeInterface(s {wrpc}.Server, h Handler) (stop func() error, err error) {
{slog}.DebugContext(ctx, "transmitting `{instance}.{name}` result")
_, err = w.Write(buf.Bytes())
if err != nil {{
{slog}.WarnContext(ctx, "failed to write result", "{instance}", "name", "{name}", "err", err)
{slog}.WarnContext(ctx, "failed to write result", "instance", "{instance}", "name", "{name}", "err", err)
return
}}
if len(writes) > 0 {{
for index, write := range writes {{
w, err := w.Index(index)
if err != nil {{
{slog}.ErrorContext(ctx, "failed to index writer", "index", index, "{instance}", "name", "{name}", "err", err)
{slog}.ErrorContext(ctx, "failed to index writer", "index", index, "instance", "{instance}", "name", "{name}", "err", err)
return
}}
index := index
write := write
go func() {{
if err := write(w); err != nil {{
{slog}.WarnContext(ctx, "failed to write nested result value", "index", index, "{instance}", "name", "{name}", "err", err)
{slog}.WarnContext(ctx, "failed to write nested result value", "index", index, "instance", "{instance}", "name", "{name}", "err", err)
}}
}}()
}}
Expand Down

0 comments on commit 67fc056

Please sign in to comment.