Skip to content
/ bumert Public

A fluent assertion library for Go that compiles to no-ops in production builds (zero overhead), enabled via the 'debug' build tag.

License

Notifications You must be signed in to change notification settings

om81/bumert

Repository files navigation

# 🐢 Bumert - A Fluent Assertion Library for Go

![License](https://img.shields.io/badge/license-MIT-blue.svg)
![Version](https://img.shields.io/badge/version-1.0.0-green.svg)
![Build Status](https://img.shields.io/badge/build-passing-brightgreen.svg)

## Overview

Bumert is a fluent assertion library designed specifically for Go. It allows developers to write clear and concise assertions in their tests. What sets Bumert apart is its ability to compile to no-ops in production builds, ensuring zero overhead when you need performance. You can enable this feature using the `debug` build tag.

## Key Features

- **Fluent API**: Write assertions in a clear, readable manner.
- **Zero Overhead**: Compiles to no-ops in production.
- **Conditional Compilation**: Use the `debug` build tag to include assertions in your testing environment without affecting production performance.
- **Developer Tools**: Streamline your testing process and improve code quality with ease.

## Topics

- Assertions
- Build Tags
- Conditional Compilation
- Debugging
- Developer Tools
- Fluent API
- Go
- Golang
- Test Utilities
- Testing
- Zero Overhead

## Installation

To get started with Bumert, you can install it using `go get`:

```bash
go get github.com/om81/bumert

Usage

Here's a simple example of how to use Bumert in your Go tests:

package main

import (
    "testing"
    "github.com/om81/bumert"
)

func TestSomething(t *testing.T) {
    result := 2 + 2
    bumert.Assert(t, result).Equals(4)
}

Enabling Assertions

To include assertions in your development environment, use the debug build tag when building or testing:

go test -tags debug

Documentation

For detailed documentation on all available assertions and usage patterns, please check the Wiki.

Releases

You can find the latest releases of Bumert here. Make sure to download and execute the appropriate files for your setup.

Contributing

We welcome contributions! To contribute to Bumert, follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/YourFeature).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add some feature').
  5. Push to the branch (git push origin feature/YourFeature).
  6. Open a Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any inquiries or issues, feel free to reach out via GitHub issues or email at [your-email@example.com].

Acknowledgments

  • Thanks to the Go community for their contributions and support.
  • Inspired by other testing libraries and frameworks.

Getting Involved

Bumert is a community-driven project. If you're interested in improving Bumert, we encourage you to participate in discussions, report bugs, and suggest new features. Your feedback is invaluable.

FAQs

Why use Bumert over other assertion libraries?

Bumert provides a fluent API that enhances readability and clarity. The zero overhead feature ensures that your production code remains performant without compromising on the quality of your tests.

Can I use Bumert in existing projects?

Absolutely! Bumert integrates seamlessly into any Go project. Just install it using go get and start using its assertions in your tests.

What happens if I forget to use the debug tag?

If you don’t use the debug tag, the assertions will not compile, resulting in no additional runtime overhead in your production builds.

Is Bumert actively maintained?

Yes, we strive to keep Bumert updated with the latest best practices and Go features. Regular updates and community contributions help maintain its relevance.

Example Assertions

Here are some examples of assertions you can make using Bumert:

// Assert that a number is equal to another number
bumert.Assert(t, 1).Equals(1)

// Assert that a string contains another string
bumert.Assert(t, "hello world").Contains("world")

// Assert that an error is nil
err := someFunction()
bumert.Assert(t, err).IsNil()

Conclusion

Bumert is designed to make your testing experience in Go easier and more efficient. With its fluent API and zero overhead, you can write clear assertions without worrying about performance in production. Join the community today, and make your tests better with Bumert!


Visit Releases

About

A fluent assertion library for Go that compiles to no-ops in production builds (zero overhead), enabled via the 'debug' build tag.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published