From ad645b05366b445afb9ad00dd240c9a1baceeb92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1si=20Istv=C3=A1n?= Date: Tue, 10 Dec 2024 00:34:27 +0100 Subject: [PATCH] Add Sting() method to RequestNameReply and ReleaseNameReply. --- export.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/export.go b/export.go index fa009d2..7b4e78b 100644 --- a/export.go +++ b/export.go @@ -438,6 +438,18 @@ const ( ReleaseNameReplyNotOwner ) +func (rep ReleaseNameReply) String() string { + switch rep { + case ReleaseNameReplyReleased: + return "released" + case ReleaseNameReplyNonExistent: + return "non existent" + case ReleaseNameReplyNotOwner: + return "not owner" + } + return "unknown" +} + // RequestNameFlags represents the possible flags for a RequestName call. type RequestNameFlags uint32 @@ -456,3 +468,17 @@ const ( RequestNameReplyExists RequestNameReplyAlreadyOwner ) + +func (rep RequestNameReply) String() string { + switch rep { + case RequestNameReplyPrimaryOwner: + return "primary owner" + case RequestNameReplyInQueue: + return "in queue" + case RequestNameReplyExists: + return "exists" + case RequestNameReplyAlreadyOwner: + return "already owner" + } + return "unknown" +}