-
-
-
-
-
-
-
-
-
-
-
-
-
v0.17.1585b61e3 · ·
Correct Params to Parens in Operators example diff --git a/README.md b/README.md index 77036b4..640eb97 100644 --- a/README.md +++ b/README.md @@ -190,7 +190,7 @@ fmt.Printf("%#v", c) ``` ```go -c := If(Params(Id("a").Op("||").Id("b")).Op("&&").Id("c")).Block() +c := If(Parens(Id("a").Op("||").Id("b")).Op("&&").Id("c")).Block() fmt.Printf("%#v", c) // Output: // if (a || b) && c { diff --git a/jen/examples_test.go b/jen/examples_test.go index 7f65169..24f0d90 100644 --- a/jen/examples_test.go +++ b/jen/examples_test.go @@ -141,7 +141,7 @@ func ExampleFile_CgoPreamble_no_preamble_anon() { } func ExampleOp_complex_conditions() { - c := If(Params(Id("a").Op("||").Id("b")).Op("&&").Id("c")).Block() + c := If(Parens(Id("a").Op("||").Id("b")).Op("&&").Id("c")).Block() fmt.Printf("%#v", c) // Output:
-
-
-
v0.15.05e2dacf7 · ·
Reorder comments docs in readme diff --git a/README.md b/README.md index 4627074..584560a 100644 --- a/README.md +++ b/README.md @@ -891,13 +891,13 @@ fmt.Printf("%#v", f) ``` ### Comments +PackageComment adds a comment to the top of the file, above the package +keyword. + HeaderComment adds a comment to the top of the file, above any package comments. A blank line is rendered below the header comments, ensuring header comments are not included in the package doc. -PackageComment adds a comment to the top of the file, above the package -keyword. - ```go f := NewFile("c") f.HeaderComment("Code generated by...") diff --git a/README.md.tpl b/README.md.tpl index c4fd61f..f51af6a 100644 --- a/README.md.tpl +++ b/README.md.tpl @@ -384,10 +384,10 @@ avoid this, use Clone. {{ "Statement.Clone" | doc }} {{ "ExampleFile_Anon" | example }} ### Comments -{{ "File.HeaderComment" | doc }} - {{ "File.PackageComment" | doc }} +{{ "File.HeaderComment" | doc }} + {{ "ExampleFile_HeaderAndPackageComments" | example }}
-
v0.14.059fb95b0 · ·
Simplified package alias guessing Added keywords, predeclared identifiers and common names to reserved words for package aliases
-