diff options
author | Alex Pilon <apilon@hashicorp.com> | 2019-02-22 18:24:37 -0500 |
---|---|---|
committer | Alex Pilon <apilon@hashicorp.com> | 2019-02-22 18:24:37 -0500 |
commit | 15c0b25d011f37e7c20aeca9eaf461f78285b8d9 (patch) | |
tree | 255c250a5c9d4801c74092d33b7337d8c14438ff /vendor/github.com/hashicorp/go-uuid | |
parent | 07971ca38143c5faf951d152fba370ddcbe26ad5 (diff) | |
download | terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.gz terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.zst terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.zip |
deps: github.com/hashicorp/terraform@sdk-v0.11-with-go-modules
Updated via: go get github.com/hashicorp/terraform@sdk-v0.11-with-go-modules and go mod tidy
Diffstat (limited to 'vendor/github.com/hashicorp/go-uuid')
-rw-r--r-- | vendor/github.com/hashicorp/go-uuid/.travis.yml | 12 | ||||
-rw-r--r-- | vendor/github.com/hashicorp/go-uuid/README.md | 4 | ||||
-rw-r--r-- | vendor/github.com/hashicorp/go-uuid/go.mod | 1 | ||||
-rw-r--r-- | vendor/github.com/hashicorp/go-uuid/uuid.go | 16 |
4 files changed, 27 insertions, 6 deletions
diff --git a/vendor/github.com/hashicorp/go-uuid/.travis.yml b/vendor/github.com/hashicorp/go-uuid/.travis.yml new file mode 100644 index 0000000..7698490 --- /dev/null +++ b/vendor/github.com/hashicorp/go-uuid/.travis.yml | |||
@@ -0,0 +1,12 @@ | |||
1 | language: go | ||
2 | |||
3 | sudo: false | ||
4 | |||
5 | go: | ||
6 | - 1.4 | ||
7 | - 1.5 | ||
8 | - 1.6 | ||
9 | - tip | ||
10 | |||
11 | script: | ||
12 | - go test -bench . -benchmem -v ./... | ||
diff --git a/vendor/github.com/hashicorp/go-uuid/README.md b/vendor/github.com/hashicorp/go-uuid/README.md index 21fdda4..fbde8b9 100644 --- a/vendor/github.com/hashicorp/go-uuid/README.md +++ b/vendor/github.com/hashicorp/go-uuid/README.md | |||
@@ -1,6 +1,6 @@ | |||
1 | # uuid | 1 | # uuid [![Build Status](https://travis-ci.org/hashicorp/go-uuid.svg?branch=master)](https://travis-ci.org/hashicorp/go-uuid) |
2 | 2 | ||
3 | Generates UUID-format strings using purely high quality random bytes. | 3 | Generates UUID-format strings using high quality, _purely random_ bytes. It is **not** intended to be RFC compliant, merely to use a well-understood string representation of a 128-bit value. It can also parse UUID-format strings into their component bytes. |
4 | 4 | ||
5 | Documentation | 5 | Documentation |
6 | ============= | 6 | ============= |
diff --git a/vendor/github.com/hashicorp/go-uuid/go.mod b/vendor/github.com/hashicorp/go-uuid/go.mod new file mode 100644 index 0000000..dd57f9d --- /dev/null +++ b/vendor/github.com/hashicorp/go-uuid/go.mod | |||
@@ -0,0 +1 @@ | |||
module github.com/hashicorp/go-uuid | |||
diff --git a/vendor/github.com/hashicorp/go-uuid/uuid.go b/vendor/github.com/hashicorp/go-uuid/uuid.go index 322b522..ff9364c 100644 --- a/vendor/github.com/hashicorp/go-uuid/uuid.go +++ b/vendor/github.com/hashicorp/go-uuid/uuid.go | |||
@@ -6,13 +6,21 @@ import ( | |||
6 | "fmt" | 6 | "fmt" |
7 | ) | 7 | ) |
8 | 8 | ||
9 | // GenerateUUID is used to generate a random UUID | 9 | // GenerateRandomBytes is used to generate random bytes of given size. |
10 | func GenerateUUID() (string, error) { | 10 | func GenerateRandomBytes(size int) ([]byte, error) { |
11 | buf := make([]byte, 16) | 11 | buf := make([]byte, size) |
12 | if _, err := rand.Read(buf); err != nil { | 12 | if _, err := rand.Read(buf); err != nil { |
13 | return "", fmt.Errorf("failed to read random bytes: %v", err) | 13 | return nil, fmt.Errorf("failed to read random bytes: %v", err) |
14 | } | 14 | } |
15 | return buf, nil | ||
16 | } | ||
15 | 17 | ||
18 | // GenerateUUID is used to generate a random UUID | ||
19 | func GenerateUUID() (string, error) { | ||
20 | buf, err := GenerateRandomBytes(16) | ||
21 | if err != nil { | ||
22 | return "", err | ||
23 | } | ||
16 | return FormatUUID(buf) | 24 | return FormatUUID(buf) |
17 | } | 25 | } |
18 | 26 | ||