Skip to content

Commit

Permalink
update version string trim method to include whitespace
Browse files Browse the repository at this point in the history
Change-Id: I352811ed70b7ea85c896acb1c6415b5f87f16b8a
Signed-off-by: Jake Sanders <jsand@google.com>
  • Loading branch information
Jake Sanders committed Jan 12, 2017
1 parent 9967470 commit 707cf49
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"runtime"
"strconv"
"strings"
"unicode"
)

// SdkConfigPath tries to return the directory where the gcloud config is
Expand Down Expand Up @@ -60,11 +61,10 @@ func DockerClientVersionStrings() (string, string, string, error) {

vstring := string(out)

// Remove any leading/trailing whitespace
vstring = strings.TrimSpace(vstring)

// Remove any leading/trailing '
vstring = strings.Trim(vstring, "'")
// Remove any leading/trailing whitespace or '
vstring = strings.TrimFunc(vstring, func(r rune) bool {
return unicode.IsSpace(r) || r == '\''
})

ver := strings.Split(vstring, ".")

Expand Down

0 comments on commit 707cf49

Please sign in to comment.