3 ms·
I know it doesn't matter, but... ...who invented this letter-casing convention? import ( "embed" "html/template" "net/http" )
by azangru 5mo ago
I know it doesn't matter, but...
...who invented this letter-casing convention?
import (
"embed"
"html/template"
"net/http"
)
//go:embed templates/*.html
var files embed.FS
var tmpl = template.Must(template.ParseFS(files, "templates/*.html"))
why is the name of a module lower-cased
but the names of functions accessed via its namespace upper-cased?
how does this make sense?
- lanstin 5mo agoUpper case symbols in a module are exported. Everything else should be lower case.
- azangru 5mo agoOh; in that case the lowly Javascript/typescript does this so much cleaner with the explicit `export` keyword. "Explicit is better than implicit."
- x0re4x 5mo agoGo language is explicit: identifiers starting with a capital letter are exported. https://go.dev/ref/spec#Exported_identifiers https://go.dev/ref/spec#Exported_identifiers
- lanstin 5mo agoI find “locality of scope” to be extremely significant fact about a variable, and so I like seeing signs of it at one glance. The . as well for everything tied in a class and the go convention of shorter names for function locals also support this awarenes.
- deleted 5mo ago[deleted]