From 8842791e3418766e109b7b169c2f58ce281a62d1 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 3 Mar 2026 00:01:15 -0700 Subject: [PATCH] fix(auth): update test --- auth/request_example_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/auth/request_example_test.go b/auth/request_example_test.go index 7861354..371f45e 100644 --- a/auth/request_example_test.go +++ b/auth/request_example_test.go @@ -20,8 +20,7 @@ func (exampleCredentialStore) Authenticate(username, password string) (auth.Basi // Set the WWW-Authenticate header before writing a 401 to instruct the browser // to prompt for Username and Password on failure. func ExampleBasicRequestAuthenticator() { - ra := auth.NewBasicRequestAuthenticator() - ra.Authenticator = exampleCredentialStore{} // swap in your real credential store + ra := auth.NewBasicRequestAuthenticator(exampleCredentialStore{}) http.HandleFunc("/api/", func(w http.ResponseWriter, r *http.Request) { principle, err := ra.Authenticate(r) @@ -30,6 +29,6 @@ func ExampleBasicRequestAuthenticator() { http.Error(w, "Unauthorized", http.StatusUnauthorized) return } - fmt.Fprintf(w, "hello %s", principle.ID()) + _, _ = fmt.Fprintf(w, "hello %s", principle.ID()) }) }