mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-26 03:15:11 +00:00
fix: license issue in blob disk feature
This commit is contained in:
19
vendor/github.com/rubiojr/go-vhd/vhd/util.go
generated
vendored
19
vendor/github.com/rubiojr/go-vhd/vhd/util.go
generated
vendored
@@ -1,13 +1,10 @@
|
||||
package vhd
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"unicode/utf16"
|
||||
"unicode/utf8"
|
||||
)
|
||||
|
||||
// https://groups.google.com/forum/#!msg/golang-nuts/d0nF_k4dSx4/rPGgfXv6QCoJ
|
||||
@@ -55,19 +52,3 @@ func uuidToBytes(uuid string) []byte {
|
||||
|
||||
return h
|
||||
}
|
||||
|
||||
/*
|
||||
utf16BytesToString converts UTF-16 encoded bytes, in big or
|
||||
little endian byte order, to a UTF-8 encoded string.
|
||||
http://stackoverflow.com/a/15794113
|
||||
*/
|
||||
func utf16BytesToString(b []byte, o binary.ByteOrder) string {
|
||||
utf := make([]uint16, (len(b)+(2-1))/2)
|
||||
for i := 0; i+(2-1) < len(b); i += 2 {
|
||||
utf[i/2] = o.Uint16(b[i:])
|
||||
}
|
||||
if len(b)/2 < len(utf) {
|
||||
utf[len(utf)-1] = utf8.RuneError
|
||||
}
|
||||
return string(utf16.Decode(utf))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user