Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md: add missing 'time' import in code example #49

Merged
merged 2 commits into from
Nov 28, 2024

Conversation

neuralcoral
Copy link
Contributor

Description

This PR fixes an issue in the README.md code example where the time package is not imported. Without this import, users attempting to run the example code receive the following error:

./main.go:23:32: undefined: time

Changes

  • Added the missing time import in the README.md example code.

Motivation

Adding the time import improves the accuracy of the README example, allowing users to copy and run the example without encountering errors.

README.md Outdated Show resolved Hide resolved
Copy link

Benchmark Results

goos: linux
goarch: amd64
pkg: github.com/go-chi/httprate
cpu: AMD EPYC 7763 64-Core Processor                
               │ master.txt  │               pr.txt               │
               │   sec/op    │   sec/op     vs base               │
LocalCounter-4   19.40m ± 2%   19.67m ± 1%  +1.40% (p=0.019 n=10)

               │  master.txt  │             pr.txt             │
               │     B/op     │     B/op      vs base          │
LocalCounter-4   2.833Mi ± 0%   2.830Mi ± 0%  ~ (p=0.218 n=10)

               │ master.txt  │            pr.txt             │
               │  allocs/op  │  allocs/op   vs base          │
LocalCounter-4   121.5k ± 0%   121.4k ± 0%  ~ (p=0.184 n=10)

Copy link
Contributor

@VojtechVitek VojtechVitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you

@VojtechVitek VojtechVitek merged commit 9d627fb into go-chi:master Nov 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants