mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #16103 from HuKeping/format
Refactor some code to use simply format
This commit is contained in:
commit
3fdfbd43b6
1 changed files with 2 additions and 4 deletions
|
@ -27,8 +27,7 @@ func (graph *Graph) WalkHistory(img *image.Image, handler func(image.Image) erro
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// depth returns the number of parents for a
|
// depth returns the number of parents for the current image
|
||||||
// current image
|
|
||||||
func (graph *Graph) depth(img *image.Image) (int, error) {
|
func (graph *Graph) depth(img *image.Image) (int, error) {
|
||||||
var (
|
var (
|
||||||
count = 0
|
count = 0
|
||||||
|
@ -38,8 +37,7 @@ func (graph *Graph) depth(img *image.Image) (int, error) {
|
||||||
|
|
||||||
for parent != nil {
|
for parent != nil {
|
||||||
count++
|
count++
|
||||||
parent, err = graph.GetParent(parent)
|
if parent, err = graph.GetParent(parent); err != nil {
|
||||||
if err != nil {
|
|
||||||
return -1, err
|
return -1, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue