gin-contrib / gin-contrib/static
[Feature request] Add slightly more documentation for the parameters in `static.LocalFile`
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 321
- Forks
- 44
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 2
Description
While the first parameter in static.LocalFile is obvious, the second one — dealing with directory index files — is not. Namely, it's not really obvious that false actually means "skip the index.html file on the root of this directory" (or something like that).
Please consider one of the following:
- Add a little more documentation explaining what this parameter is for, and in which cases it's best to leave it on
false; - Add two new constants, say,
static.UseIndexHTMLandstatic.SkipIndexHTMLor something descriptive like that, which get set totrueandfalserespectively (to avoid breaking earlier code).
(or consider both!)
It's far easier to understand what r.Use(static.Serve("/static"), static.LocalFile("/path/to/static/files", static.SkipIndexHTML)) means — especially when looking at code after several months or years without remembering what true and false do in this case :)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the static.LocalFile API and the static.Serve usage described in the issue. Clarify the second parameter's true and false behavior, and determine whether documentation, named constants, or both are appropriate. Done means a reader can understand the option without remembering its boolean meaning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, documentation
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100