Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for REDACTED_TOKEN (0.2 sec)

  1. src/log/slog/example_logvaluer_secret_test.go

    )
    
    // A token is a secret value that grants permissions.
    type Token string
    
    // LogValue implements slog.LogValuer.
    // It avoids revealing the token.
    func (Token) LogValue() slog.Value {
    	return slog.StringValue("REDACTED_TOKEN")
    }
    
    // This example demonstrates a Value that replaces itself
    // with an alternative representation to avoid revealing secrets.
    func ExampleLogValuer_secret() {
    	t := Token("shhhh!")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 04 18:32:54 UTC 2023
    - 906 bytes
    - Viewed (0)
Back to top