diff --git a/mage/main_test.go b/mage/main_test.go index b722d842..cfa22741 100644 --- a/mage/main_test.go +++ b/mage/main_test.go @@ -593,7 +593,9 @@ func TestList(t *testing.T) { } actual := stdout.String() expected := ` -This is a comment on the package which should get turned into output with the list of targets. +This is a comment on the package which should get turned into output with the +list of targets. + Targets: somePig* This is the synopsis for SomePig. @@ -629,7 +631,9 @@ func TestListWithColor(t *testing.T) { os.Setenv(mg.TargetColorEnv, mg.Cyan.String()) expectedPlainText := ` -This is a comment on the package which should get turned into output with the list of targets. +This is a comment on the package which should get turned into output with the +list of targets. + Targets: somePig* This is the synopsis for SomePig. @@ -642,8 +646,8 @@ Targets: // in the middle and join with a normal string for the target names, // otherwise the single backslash would be taken literally and encoded as \\ expectedColorizedText := "" + - "This is a comment on the package which should get turned into output with the list of targets.\n" + - "\n" + + "This is a comment on the package which should get turned into output with the\nlist of targets.\n" + + "\n\n" + "Targets:\n" + " \x1b[36msomePig*\x1b[0m This is the synopsis for SomePig.\n" + " \x1b[36mtestVerbose\x1b[0m \n" + @@ -730,7 +734,9 @@ func TestIgnoreDefault(t *testing.T) { } actual := stdout.String() expected := ` -This is a comment on the package which should get turned into output with the list of targets. +This is a comment on the package which should get turned into output with the +list of targets. + Targets: somePig* This is the synopsis for SomePig. diff --git a/parse/parse.go b/parse/parse.go index 48cf1ece..e5f22fe4 100644 --- a/parse/parse.go +++ b/parse/parse.go @@ -247,7 +247,7 @@ func Package(path string, files []string) (*PkgInfo, error) { pi := &PkgInfo{ AstPkg: pkg, DocPkg: p, - Description: toOneLine(p.Doc), + Description: p.Doc, } setNamespaces(pi)