https://github.com/rikonor/go-redact
https://github.com/rikonor/go-redact
redact
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rikonor/go-redact
- Owner: rikonor
- License: mit
- Created: 2017-09-14T14:21:37.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-25T22:34:31.000Z (almost 8 years ago)
- Last Synced: 2025-01-09T16:19:11.218Z (9 months ago)
- Topics: redact
- Language: Go
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
go-redact
---Redact strings containing passwords.
### Usage
_URI_
```go
// With error handling
u, err := redact.URI("http://user:pass@github.com")
if err != nil {
log.Fatalf("failed to redact: %s", err) // Will happen if input is not a valid URI
}fmt.Println(u)
// Output:
// http://user:REDACTED@github.com
``````go
// Without error handling
u := redact.MustURI("adkljsaldjksla")fmt.Println(u)
// Output:
// FAILED_TO_REDACT
```