update vendor

This commit is contained in:
Qiu Jian
2018-12-19 01:02:04 +08:00
parent 00d8dba7bd
commit 3e0c2ecd73
683 changed files with 97802 additions and 13304 deletions
@@ -13,7 +13,7 @@ type SectorReadError struct {
// Error returns the string representation of the SectorReadError instance.
//
func (e *SectorReadError) Error() string {
return fmt.Sprint("Read sector '%d' of block '%d' failed: %s", e.SectorIndex, e.BlockIndex, e.err)
return fmt.Sprintf("Read sector '%d' of block '%d' failed: %s", e.SectorIndex, e.BlockIndex, e.err)
}
// NewSectorReadError returns a new SectorReadError instance.
@@ -19,8 +19,8 @@ type DiskStream struct {
offset int64
size int64
isClosed bool
vhdFactory *vhdFile.FileFactory
vhdFile *vhdFile.VhdFile
vhdFactory *vhdfile.FileFactory
vhdFile *vhdfile.VhdFile
vhdBlockFactory block.Factory
vhdFooterRange *common.IndexRange
vhdDataRange *common.IndexRange
@@ -39,7 +39,7 @@ type StreamExtent struct {
func CreateNewDiskStream(vhdPath string) (*DiskStream, error) {
var err error
stream := &DiskStream{offset: 0, isClosed: false}
stream.vhdFactory = &vhdFile.FileFactory{}
stream.vhdFactory = &vhdfile.FileFactory{}
if stream.vhdFile, err = stream.vhdFactory.Create(vhdPath); err != nil {
return nil, err
}
+1 -1
View File
@@ -35,5 +35,5 @@ func (v VhdFeature) String() string {
return "Reserved"
}
return fmt.Sprint("%d", v)
return fmt.Sprintf("%d", v)
}
@@ -55,5 +55,5 @@ func (p PlatformCode) String() string {
return "MacX"
}
return fmt.Sprint("%d", p)
return fmt.Sprintf("%d", p)
}
@@ -14,7 +14,7 @@ const oneTB int64 = 1024 * 1024 * 1024 * 1024
// ValidateVhd returns error if the vhdPath refer to invalid vhd.
//
func ValidateVhd(vhdPath string) error {
vFactory := &vhdFile.FileFactory{}
vFactory := &vhdfile.FileFactory{}
_, err := vFactory.Create(vhdPath)
if err != nil {
return fmt.Errorf("%s is not a valid VHD: %v", vhdPath, err)
+3 -2
View File
@@ -1,4 +1,4 @@
package vhdFile
package vhdfile
import (
"fmt"
@@ -16,7 +16,8 @@ type VhdFile struct {
// Footer represents the disk's footer.
Footer *footer.Footer
// Header represents the disk's header, this field is nil for fixed VHD.
// Only Dynamic and Differencing disk has header.
// Only Dynamic and Differencing disk has header.make
Header *header.Header
// BlockAllocationTable represents the table holding absolute offset to the first sector
// of blocks in the disk. Only Dynamic and Differencing disk has BAT.
@@ -1,4 +1,4 @@
package vhdFile
package vhdfile
import (
"os"