Skip to content

Commit

Permalink
use safe String() for UserIdentity (#227) (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackysp authored Mar 4, 2019
1 parent c68bfe7 commit 9f218bd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ type UserIdentity struct {
// String converts UserIdentity to the format user@host.
func (user *UserIdentity) String() string {
// TODO: Escape username and hostname.
if user == nil {
return ""
}
return fmt.Sprintf("%s@%s", user.Username, user.Hostname)
}

Expand Down

0 comments on commit 9f218bd

Please sign in to comment.