bagend.adoc 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. = bagend
  2. apiote <me@apiote.xyz>
  3. v1.0.0 2022-02-10
  4. :toc:
  5. bagend is a simple library which provides `Assert` and kotlin-like `TODO` functions for Go.
  6. == Usage
  7. `Assert` accepts two arguments: `bool` condition and a `string` message. If the condition is false, `Assert` panics with `string` including the message from second argument and the position in code.
  8. ----
  9. // this will pass
  10. bagend.Assert(2+2 == 4, "2+2 must equal 4")
  11. // this will panic
  12. bagend.Assert(2+2 == 5, "2+2 must equal 4")
  13. ----
  14. `TODO` accepts a `string` message and always panics with it and position in code. It also returns an `interface{}` so that it can be used in functions that return.
  15. ----
  16. func convertNumber(number int) int {
  17. return bagend.TODO("implement me later").(int)
  18. }
  19. ----
  20. == Contribute
  21. This project is finished; no more functions will be implemented; all feature requests will be ignored.
  22. This project uses The Code of Merit, which is available as CODE_OF_CONDUCT file.
  23. Fixes and patches are welcome; please send them to `bagend@git.apiote.xyz` using `git send-email`. They must include a sign-off to certify agreement to https://developercertificate.org/[Developer Certificate of Origin].
  24. All communication—questions, bugs, etc.—should go through the mailing list available at `bagend@git.apiote.xyz`. Note that all communication will be made public at https://asgard.apiote.xyz/.
  25. == Mirrors
  26. The canonical repository for this project is https://git.apiote.xyz/bagend.git it’s mirrored at https://notabug.org/apiote/bagend
  27. Mirrors exist solely for the sake of the code and any additional functions provided by third-party services (including but not limited to issues and pull requests) will not be used and will be ignored.
  28. == License
  29. ----
  30. This Source Code Form is subject to the terms of the Mozilla Public
  31. License, v. 2.0. If a copy of the MPL was not distributed with this
  32. file, You can obtain one at https://mozilla.org/MPL/2.0/.
  33. ----