<commit_before># werrors

## Name

werrors := **w**rap **errors**

## Simple example

```go
package main

import (
    "errors"
    "github.com/PaulRaUnite/werrors"
    "fmt"
)

func main() {
    err := errors.New("error")
    err = werrors.Wrap(err, "annotation")
    fmt.Println(err)
}
```
`Output: annotation *> error`

## Purpose

The package was created as a part of my pet project,
because I needed something for tracking
errors and adding context of a lot of
calls of the same function with different arguments
(file names).

## Installation

`go get github.com/PaulRaUnite/werrors`

## Dependencies

Only `fmt` package.

## Performance

All functions can be divided into two groups:

Allocation free | With allocation/s
----------------|----------------
`Wrap`          | `Wrapf`
`DefWrap`       | `DefWrapf`
`Cause`         | `tracker.Error`

Of course, allocation free functions are faster.

**Important**:
  > `tracker.Error` produces cascade of allocations
  > because of it's recursion nature.
  
## Documentation + Examples

See [godoc](https://godoc.com/github.com/PaulRaUnite/werrors)

## Collaboration

Common scheme:
 - Create an issue and discuss a problem
  (omit it if the issue is small, something like
   grammar mistake in README :D);
 - Fork repository and commit your changes;
 - Pull request with reference to the issue;
 - Wait for review (maybe with some discussion);
 - Merging.

If your request wasn't merged, don't worry, you always
can create a fork. :wink:

## Possible questions

### Why do you use strings as annotation container?

Because of their immutability.

Yes, you can use some hacks (`unsafe` package can give
you direct access to `[]byte` inside `string`) to bypass
the constraint and change something inside,
but don't do it, it's ridiculous. :)
In this case, of course.
 
It can be helpful to optimize builtin conversion between
`[]byte` to `string` applying your own conversion 
in cases of high performance when you are sure 
in the immutability of byte slice, of course.<commit_msg>Fix mistake in README (link to godoc).<commit_after># werrors

## Name

werrors := **w**rap **errors**

## Simple example

```go
package main

import (
    "errors"
    "github.com/PaulRaUnite/werrors"
    "fmt"
)

func main() {
    err := errors.New("error")
    err = werrors.Wrap(err, "annotation")
    fmt.Println(err)
}
```
`Output: annotation *> error`

## Purpose

The package was created as a part of my pet project,
because I needed something for tracking
errors and adding context of a lot of
calls of the same function with different arguments
(file names).

## Installation

`go get github.com/PaulRaUnite/werrors`

## Dependencies

Only `fmt` package.

## Performance

All functions can be divided into two groups:

Allocation free | With allocation/s
----------------|----------------
`Wrap`          | `Wrapf`
`DefWrap`       | `DefWrapf`
`Cause`         | `tracker.Error`

Of course, allocation free functions are faster.

**Important**:
  > `tracker.Error` produces cascade of allocations
  > because of it's recursion nature.
  
## Documentation + Examples

See [godoc](https://godoc.org/github.com/PaulRaUnite/werrors)

## Collaboration

Common scheme:
 - Create an issue and discuss a problem
  (omit it if the issue is small, something like
   grammar mistake in README :D);
 - Fork repository and commit your changes;
 - Pull request with reference to the issue;
 - Wait for review (maybe with some discussion);
 - Merging.

If your request wasn't merged, don't worry, you always
can create a fork. :wink:

## Possible questions

### Why do you use strings as annotation container?

Because of their immutability.

Yes, you can use some hacks (`unsafe` package can give
you direct access to `[]byte` inside `string`) to bypass
the constraint and change something inside,
but don't do it, it's ridiculous. :)
In this case, of course.
 
It can be helpful to optimize builtin conversion between
`[]byte` to `string` applying your own conversion 
in cases of high performance when you are sure 
in the immutability of byte slice, of course.

{'fraction_non_alphanumeric': 0.10972629521016618, 'fraction_numerical': 0.0, 'mean_word_length': 3.5629877369007805, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2508248', 'n_tokens_mistral': 1229, 'n_tokens_neox': 1174, 'n_words': 511}