summaryrefslogtreecommitdiff
path: root/vendor/github.com/Microsoft/hcsshim/internal/guid
diff options
context:
space:
mode:
authorTomSweeneyRedHat <tsweeney@redhat.com>2019-11-13 10:30:08 -0500
committerTomSweeneyRedHat <tsweeney@redhat.com>2019-11-13 10:57:19 -0500
commit6003033adae775f1d725b05231a246a4462ae669 (patch)
treec570c523df92c3c0fb4b704c5c45b0de6603b7d6 /vendor/github.com/Microsoft/hcsshim/internal/guid
parentde32b89eff0928abdef9d85a420b65d8865e737e (diff)
downloadpodman-6003033adae775f1d725b05231a246a4462ae669.tar.gz
podman-6003033adae775f1d725b05231a246a4462ae669.tar.bz2
podman-6003033adae775f1d725b05231a246a4462ae669.zip
Bump to Buildah v1.11.5
Bump to Buildah v1.11.5. Most notably changes to the podman build `--pull` functionality. `--pull=true` and `--pull=false` now work as Docker does, `--pull-never` added to supply the functionality of the old `--pull=false`. Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
Diffstat (limited to 'vendor/github.com/Microsoft/hcsshim/internal/guid')
-rw-r--r--vendor/github.com/Microsoft/hcsshim/internal/guid/guid.go69
1 files changed, 0 insertions, 69 deletions
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/guid/guid.go b/vendor/github.com/Microsoft/hcsshim/internal/guid/guid.go
deleted file mode 100644
index e9e45c030..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/guid/guid.go
+++ /dev/null
@@ -1,69 +0,0 @@
-package guid
-
-import (
- "crypto/rand"
- "encoding/json"
- "fmt"
- "io"
- "strconv"
- "strings"
-)
-
-var _ = (json.Marshaler)(&GUID{})
-var _ = (json.Unmarshaler)(&GUID{})
-
-type GUID [16]byte
-
-func New() GUID {
- g := GUID{}
- _, err := io.ReadFull(rand.Reader, g[:])
- if err != nil {
- panic(err)
- }
- return g
-}
-
-func (g GUID) String() string {
- return fmt.Sprintf("%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x-%02x", g[3], g[2], g[1], g[0], g[5], g[4], g[7], g[6], g[8:10], g[10:])
-}
-
-func FromString(s string) GUID {
- if len(s) != 36 {
- panic(fmt.Sprintf("invalid GUID length: %d", len(s)))
- }
- if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' {
- panic("invalid GUID format")
- }
- indexOrder := [16]int{
- 0, 2, 4, 6,
- 9, 11,
- 14, 16,
- 19, 21,
- 24, 26, 28, 30, 32, 34,
- }
- byteOrder := [16]int{
- 3, 2, 1, 0,
- 5, 4,
- 7, 6,
- 8, 9,
- 10, 11, 12, 13, 14, 15,
- }
- var g GUID
- for i, x := range indexOrder {
- b, err := strconv.ParseInt(s[x:x+2], 16, 16)
- if err != nil {
- panic(err)
- }
- g[byteOrder[i]] = byte(b)
- }
- return g
-}
-
-func (g GUID) MarshalJSON() ([]byte, error) {
- return json.Marshal(g.String())
-}
-
-func (g *GUID) UnmarshalJSON(data []byte) error {
- *g = FromString(strings.Trim(string(data), "\""))
- return nil
-}