Skip to content

Fix Go SDK code sample errors#36077

Open
RomainMuller wants to merge 1 commit intomasterfrom
romain.marcadier/fix-go-sdk-code-errors
Open

Fix Go SDK code sample errors#36077
RomainMuller wants to merge 1 commit intomasterfrom
romain.marcadier/fix-go-sdk-code-errors

Conversation

@RomainMuller
Copy link
Copy Markdown
Contributor

@RomainMuller RomainMuller commented Apr 17, 2026

What does this PR do? What is the motivation?

Fixes two errors in the Go SDK code sample:

  • Corrects r.Query() to r.URL.Query() (http.Request has no .Query() method).
  • Replaces an out-of-scope metadata variable reference in the login failure
    tracking call with nil.

Merge instructions

Merge readiness:

  • Ready for merge

Additional notes

Fix http.Request.Query() call (should be r.URL.Query()) and replace an
out-of-scope variable reference with nil in the login failure tracking call.

JJ-Change-Id: syznml

// Track failed login
appsec.TrackUserLoginFailure(r.Context(), req.Username, true, metadata)
appsec.TrackUserLoginFailure(r.Context(), req.Username, true, nil)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no metadata in scope here... Using nil here is valid... We could also have introduced a metadata variable there alternatively. I think both approaches are valid for the sake of the example.

@RomainMuller RomainMuller marked this pull request as ready for review April 17, 2026 08:27
@RomainMuller RomainMuller requested a review from a team as a code owner April 17, 2026 08:27
@github-actions
Copy link
Copy Markdown
Contributor

Preview links (active after the build_preview check completes)

Modified Files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants