add a string representation for the perspective

This commit is contained in:
Marten Seemann
2018-02-01 12:59:24 +08:00
parent d9d384b6ed
commit 2ec147ccfa
2 changed files with 25 additions and 0 deletions

View File

@@ -8,3 +8,14 @@ const (
PerspectiveServer Perspective = 1
PerspectiveClient Perspective = 2
)
func (p Perspective) String() string {
switch p {
case PerspectiveServer:
return "Server"
case PerspectiveClient:
return "Client"
default:
return "invalid perspective"
}
}