浏览代码

TrimTree now panics with a string, not an error

Wade Simba Khadder 8 年前
父节点
当前提交
523ed22a35
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1
    2
      internal/graph/graph.go

+ 1
- 2
internal/graph/graph.go 查看文件

@@ -16,7 +16,6 @@
16 16
 package graph
17 17
 
18 18
 import (
19
-	"errors"
20 19
 	"fmt"
21 20
 	"math"
22 21
 	"path/filepath"
@@ -344,7 +343,7 @@ func (g *Graph) TrimTree(kept nodePtrSet) {
344 343
 	for _, cur := range oldNodes {
345 344
 		// A node may not have multiple parents
346 345
 		if len(cur.In) > 1 {
347
-			panic(errors.New("TrimTree only works on trees.\n"))
346
+			panic("TrimTree only works on trees")
348 347
 		}
349 348
 
350 349
 		// If a node should be kept, add it to the next list of nodes