瀏覽代碼

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
 package graph
16
 package graph
17
 
17
 
18
 import (
18
 import (
19
-	"errors"
20
 	"fmt"
19
 	"fmt"
21
 	"math"
20
 	"math"
22
 	"path/filepath"
21
 	"path/filepath"
344
 	for _, cur := range oldNodes {
343
 	for _, cur := range oldNodes {
345
 		// A node may not have multiple parents
344
 		// A node may not have multiple parents
346
 		if len(cur.In) > 1 {
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
 		// If a node should be kept, add it to the next list of nodes
349
 		// If a node should be kept, add it to the next list of nodes