News for hackers. Stuff that matters.
Re:Just Fucking Use Go by azangru on Friday May 08, 2026 @10:04AM (#48063350)
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?

Re:Just Fucking Use Go by lanstin on Friday May 08, 2026 @10:24AM (#48063713)
Upper case symbols in a module are exported. Everything else should be lower case.
Re:Just Fucking Use Go by azangru on Friday May 08, 2026 @10:47AM (#48064030)
Oh; in that case the lowly Javascript/typescript does this so much cleaner with the explicit `export` keyword. "Explicit is better than implicit."
Re:Just Fucking Use Go by x0re4x on Friday May 08, 2026 @01:25PM (#48066166)
Go language is explicit: identifiers starting with a capital letter are exported.

https://go.dev/ref/spec#Exported_identifiers

Re:Just Fucking Use Go by lanstin on Sunday May 10, 2026 @05:23PM (#48088209)
I 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.