Developing an app using http.FileServer(), it became apparent by examining the net/http/fs.go dirList() function, which is used by serveFile() to emit HTML listings of directories, that the format/styling of these directory pages is hardcoded, with no facility for callers to apply basic header, footer or link styling to allow consistency with the rest of custom endpoints an application might serve, by http.HandleFunc() etc.
Basic styling allowing applications to override the basic HTTP headers, HTML header, body and footer portions of a served directory listing page would fill a significant gap in the customization facilities of the core http package, such that applications serving custom endpoints as well as bare filesystem trees could have a consistent presentation (eg. vendor backgrounds, alink styling, legal disclaimers when browsing directories, and so on).
What did you expect to see?
Some facility for applications to apply basic styling to directory pages served by http.FileServer().
What did you see instead?
Hardcoded <pre>...</pre> blocks emitted by dirList(), for directory listings, and no control over HTTP headers or alink styles.