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
|
||||
}
|
||||
|
||||
// depth returns the number of parents for a
|
||||
// current image
|
||||
// depth returns the number of parents for the current image
|
||||
func (graph *Graph) depth(img *image.Image) (int, error) {
|
||||
var (
|
||||
count = 0
|
||||
|
@ -38,8 +37,7 @@ func (graph *Graph) depth(img *image.Image) (int, error) {
|
|||
|
||||
for parent != nil {
|
||||
count++
|
||||
parent, err = graph.GetParent(parent)
|
||||
if err != nil {
|
||||
if parent, err = graph.GetParent(parent); err != nil {
|
||||
return -1, err
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue