[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [goptlib/master] Guarantee that Args.Get returns "" if no value.
commit c812cfc02d660834e3f5a5af9e25c123beccf36f
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date: Thu Jan 30 21:55:32 2014 -0800
Guarantee that Args.Get returns "" if no value.
---
args.go | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/args.go b/args.go
index 6289c8c..5e96589 100644
--- a/args.go
+++ b/args.go
@@ -14,7 +14,8 @@ import (
type Args map[string][]string
// Get the first value associated with the given key. If there are any values
-// associated with the key, the ok return value is true; otherwise it is false.
+// associated with the key, the value return has the value and ok is set to
+// true. If there are no values for the given key, value is "" and ok is false.
// If you need access to multiple values, use the map directly.
func (args Args) Get(key string) (value string, ok bool) {
if args == nil {
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits