go-chi / go-chi/httplog

`SetAttrs` does not handle concurrent writes

Open
#65 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
319
Forks
45
Avg merge
3d 16h
Merged PRs (30d)
6

Description

While potentially unlikely, calling [SetAttrs](https://github.com/go-chi/httplog/blob/master/context.go#L19) could occur simultaneously from multiple go-routines, however access to the underlying slice of `[]slog.Attr` is not protected from concurrent access.

At the very least I believe this should be mentioned in the documentation but likely should be addressed to ensure data integrity.

Happy to submit a PR if there is an appetite to address this.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.