Update Azure GO SDK to v12.1.0

This commit is contained in:
Pengfei Ni
2018-01-04 14:18:31 +08:00
parent 6d98cdbbfb
commit 0a8948d8a9
91 changed files with 904 additions and 316 deletions

View File

@@ -6,13 +6,6 @@ go:
- 1.4
- 1.5
- 1.6
- 1.7
- 1.8
- tip
matrix:
allow_failures:
- go: tip
fast_finish: true
before_install:
- go get github.com/mattn/goveralls
- go get golang.org/x/tools/cmd/cover

View File

@@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["uuid.go"],
importpath = "github.com/satori/uuid",
importpath = "github.com/satori/go.uuid",
visibility = ["//visibility:public"],
)

View File

@@ -251,12 +251,18 @@ func (u *UUID) UnmarshalText(text []byte) (err error) {
b := u[:]
for i, byteGroup := range byteGroups {
if i > 0 {
if t[0] != '-' {
err = fmt.Errorf("uuid: invalid string format")
if i > 0 && t[0] == '-' {
t = t[1:]
} else if i > 0 && t[0] != '-' {
err = fmt.Errorf("uuid: invalid string format")
return
}
if i == 2 {
if !bytes.Contains([]byte("012345"), []byte{t[0]}) {
err = fmt.Errorf("uuid: invalid version number: %s", t[0])
return
}
t = t[1:]
}
if len(t) < byteGroup {
@@ -266,11 +272,12 @@ func (u *UUID) UnmarshalText(text []byte) (err error) {
if i == 4 && len(t) > byteGroup &&
((braced && t[byteGroup] != '}') || len(t[byteGroup:]) > 1 || !braced) {
err = fmt.Errorf("uuid: UUID string too long: %s", text)
err = fmt.Errorf("uuid: UUID string too long: %s", t)
return
}
_, err = hex.Decode(b[:byteGroup/2], t[:byteGroup])
if err != nil {
return
}