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.UseIndexHTML and static.SkipIndexHTML or something descriptive like that, which get set to true and false respectively (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 :)