From 0e4607e78881d6d32ee1ca5b28c5603cf372127e Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 24 Mar 2015 16:42:56 -0700 Subject: [PATCH] Fix cycle printing The patch "Fix panic when dependency cycle includes the first module visited" caused cycles to print incorrectly by initializing the current module to be the last module in the cycle, when it should be the first module in the cycle. Change-Id: Iaf939283a48faa4cc6eeb9b19aed57993575a687 --- context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/context.go b/context.go index 08fbc13..73b5e35 100644 --- a/context.go +++ b/context.go @@ -1177,7 +1177,7 @@ func (c *Context) updateDependencies() (errs []error) { }) // Iterate backwards through the cycle list. - curModule := cycle[len(cycle)-1] + curModule := cycle[0] for i := len(cycle) - 1; i >= 0; i-- { nextModule := cycle[i] errs = append(errs, &Error{