From d18d9ffeaac2de239230b23b344c7cdf220c9c59 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Tue, 17 Jun 2014 20:45:57 +0000 Subject: [PATCH] prevent panic when empty flag Docker-DCO-1.1-Signed-off-by: Victor Vieux (github: vieux) --- mflag/flag.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mflag/flag.go b/mflag/flag.go index 2cfef33..ad23e54 100644 --- a/mflag/flag.go +++ b/mflag/flag.go @@ -778,6 +778,9 @@ func (f *FlagSet) usage() { } func trimQuotes(str string) string { + if len(str) == 0 { + return str + } type quote struct { start, end byte }