-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
📝docs(middleware): fix alignment in limiter example #2283
Conversation
Noticed a small formatting issue while going through the docs.
Thanks for opening this pull request! 🎉 Please check out our contributing guidelines. If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
@TwiN the docs for the website are hosted here: https://github.com/gofiber/docs |
@gaby I'm aware, I just happened to stumble upon the README while going through the code. If it's a non-issue because all users are expected to go strictly through the docs website, feel free to close the PR :) |
This is not how Go indents. go fmt would spit out: Max: 20,
Expiration: 30 * time.Second,
KeyGenerator: func(c *fiber.Ctx) string{ |
@leonklingele Did you try it? :P go fmt breaks alignment when a parameter is defined with more than one line. Here's an example: package main
type T struct {
Age int
SomeSlice []string
FirstName string
LastName string
}
func main() {
// If all parameters are defined on their respective line, they will all be aligned
_ = T{
Age: 123,
SomeSlice: []string{"hello", "world"},
FirstName: "John",
LastName: "Doe",
}
// If a parameter with a new line is present, the algorithm doesn't align it with the previous and next fields/parameters
_ = T{
Age: 123,
SomeSlice: []string{
"hello",
"world",
},
FirstName: "John",
LastName: "Doe",
}
} If you don't believe me, feel free to try it on https://go.dev/play/ See golang/go#31431 for more details on the reason why |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Congrats on merging your first pull request! 🎉 We here at Fiber are proud of you! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
Noticed a small alignment issue while going through the docs.