From 38a14d70696a9cab108237da41f6a3fedfe18aad Mon Sep 17 00:00:00 2001 From: Gisle Aune Date: Sun, 21 Oct 2018 12:32:21 +0200 Subject: [PATCH] client: Changed Value to return the value only, not value and ok --- client.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client.go b/client.go index 7aaba5d..6e281d5 100644 --- a/client.go +++ b/client.go @@ -376,12 +376,11 @@ func (client *Client) EmitInput(line string, target Target) context.Context { } // Value gets a client value. -func (client *Client) Value(key string) (v interface{}, ok bool) { +func (client *Client) Value(key string) interface{} { client.mutex.RLock() - v, ok = client.values[key] - client.mutex.RUnlock() + defer client.mutex.RUnlock() - return + return client.values[key] } // SetValue sets a client value.