Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
regexp: add examples for all methods on regex.Regexp #21450
I'm not sure that's a good idea. The methods are all variations on the same scheme. I don't see how enumerating the possible combinations and generating examples for them adds significant value over what's already there.
Please don't expand the docs with content that basically amounts to filler material just to satisfy some notion of exhaustiveness. If it's part of the docs, it should be worth to read. Excessive repetition is a time waster for people learning the API of a package.
If you can pull it off to demonstrate a new aspect of the package with every added example, go wild though!
Thank you @cn007b for adding more examples. Here are some remaining ones for which I think examples would be good to have to keep it consistent with the other examples.
I think once these are done, we can close this bug. The remaining ones are just simple variants of other methods which already have examples.
Updates #21450 Change-Id: Ia31c20b52bae5daeb33d918234c2f0944a8aeb07 GitHub-Last-Rev: cc85544 GitHub-Pull-Request: #33489 Reviewed-on: https://go-review.googlesource.com/c/go/+/189137 Run-TryBot: Sylvain Zimmer <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org> Reviewed-by: Ian Lance Taylor <email@example.com>
Updates #21450 Change-Id: Idf276e97f816933cc0f752cdcd5e713b5c975833 GitHub-Last-Rev: 198e585 GitHub-Pull-Request: #33490 Reviewed-on: https://go-review.googlesource.com/c/go/+/189138 Run-TryBot: Ian Lance Taylor <firstname.lastname@example.org> TryBot-Result: Gobot Gobot <email@example.com> Reviewed-by: Ian Lance Taylor <firstname.lastname@example.org>
Since I first started on this CL, most of the methods have had examples added by other folks, so this is now one new example, and additions to two existing examples for extra clarity. The issue has a comment about not necessarily having examples for all methods, but I recall finding this package pretty confusing when I first used it, and having concrete examples would have really helped me navigate all the different options. There are more String methods with examples now, but I think seeing how the byte-slice methods work could also be helpful to explain the differences. Updates #21450 Change-Id: I27b4eeb634fb8ab59f791c0961cce79a67889826 Reviewed-on: https://go-review.googlesource.com/c/go/+/120145 Reviewed-by: Daniel Martí <email@example.com> Reviewed-by: Ian Lance Taylor <firstname.lastname@example.org> Run-TryBot: Daniel Martí <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org>
updates #21450 Change-Id: Ibffe0dadc1e1523c55cd5f5b8a69bc1c399a255d GitHub-Last-Rev: 507f555 GitHub-Pull-Request: #33497 Reviewed-on: https://go-review.googlesource.com/c/go/+/189177 Run-TryBot: Ian Lance Taylor <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org> Reviewed-by: Ian Lance Taylor <email@example.com>