mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
gofmt pass
This commit is contained in:
parent
0c5e76958b
commit
d985050aeb
3 changed files with 19 additions and 19 deletions
|
@ -493,7 +493,6 @@ func (graph *Graph) PushRepository(stdout io.Writer, remote string, localRepo Re
|
|||
return fmt.Errorf("Error occured while fetching the list: %v", err)
|
||||
}
|
||||
|
||||
|
||||
// Filter list to only send images/checksums not already uploaded
|
||||
i := 0
|
||||
for _, obj := range checksums {
|
||||
|
|
17
utils.go
17
utils.go
|
@ -397,6 +397,15 @@ func CopyEscapable(dst io.Writer, src io.ReadCloser) (written int64, err error)
|
|||
return written, err
|
||||
}
|
||||
|
||||
|
||||
func HashData(src io.Reader) (string, error) {
|
||||
h := sha256.New()
|
||||
if _, err := io.Copy(h, src); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return "sha256:" + hex.EncodeToString(h.Sum(nil)), nil
|
||||
}
|
||||
|
||||
type KernelVersionInfo struct {
|
||||
Kernel int
|
||||
Major int
|
||||
|
@ -458,11 +467,3 @@ func FindCgroupMountpoint(cgroupType string) (string, error) {
|
|||
|
||||
return "", fmt.Errorf("cgroup mountpoint not found for %s", cgroupType)
|
||||
}
|
||||
|
||||
func HashData(src io.Reader) (string, error) {
|
||||
h := sha256.New()
|
||||
if _, err := io.Copy(h, src); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return "sha256:"+hex.EncodeToString(h.Sum(nil)), nil
|
||||
}
|
Loading…
Add table
Reference in a new issue