Ver código fonte

Merge pull request #16103 from HuKeping/format

Refactor some code to use simply format
Doug Davis 10 anos atrás
pai
commit
3fdfbd43b6
1 arquivos alterados com 2 adições e 4 exclusões
  1. 2 4
      graph/history.go

+ 2 - 4
graph/history.go

@@ -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
 		}
 	}