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

fix example #132

Merged
merged 2 commits into from Jun 6, 2023
Merged

fix example #132

merged 2 commits into from Jun 6, 2023

Conversation

Almenon
Copy link
Contributor

@Almenon Almenon commented May 11, 2023

In a real-world usage scenario the user will be importing golang-lru, not running it in the same file. Thus we can't just do New, we need to do lru.New. While I was at it I changed the example to be a complete runnable example.

https://replit.com/@almenon/FrenchFickleOutliers#main.go

This may seem like a very small change, but from a beginner's perspective this makes the usage a lot clearer.

In a real-world usage scenario the user will be importing golang-lru, not running it in the same file. Thus we can't just do `New`, we need to do `lru.New`. While I was at it I changed the example to be a complete runnable example. 

https://replit.com/@almenon/FrenchFickleOutliers#main.go
@hashicorp-cla
Copy link

hashicorp-cla commented May 11, 2023

CLA assistant check
All committers have signed the CLA.

@r-tierney
Copy link

Thanks @Almenon that helped me a lot. you know the docs are bad when you start going to issues / pull requests to find better examples :)

@jefferai
Copy link
Member

jefferai commented Jun 6, 2023

Thanks!

@jefferai jefferai merged commit b74c7fa into hashicorp:master Jun 6, 2023
2 checks passed
@Almenon Almenon deleted the patch-1 branch June 6, 2023 21:31
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.

None yet

4 participants