소스 검색

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