News for hackers. Stuff that matters.
Re:Show HN: Create a full language server in Go with 3.17 sp... by whateveracct on Sunday March 29, 2026 @11:41AM (#47564102)

   // DiagnosticSeverity indicates the severity of a diagnostic.
   type DiagnosticSeverity int
Hmmm :robot:
Re:Show HN: Create a full language server in Go with 3.17 sp... by jryio on Sunday March 29, 2026 @11:52AM (#47564220)
The godoc format enforces that the comment start with the name of the identifier and be a complete sentence(s) describing what that identifier does. Predates LLMs
Re:Show HN: Create a full language server in Go with 3.17 sp... by badc0ffee on Sunday March 29, 2026 @04:50PM (#47567171)
I wouldn't say it enforces that the comment start with the name of the identifier. Maybe certain linter options enforce that?

In https://go.dev/doc/comment it seems to be a convention, but there are a couple of examples there where the don't follow it.

Re:Show HN: Create a full language server in Go with 3.17 sp... by rumno0 on Sunday March 29, 2026 @11:53AM (#47564234)
Yeah some times godoc comments don't come out too good
Re:Show HN: Create a full language server in Go with 3.17 sp... by fainpul on Sunday March 29, 2026 @12:36PM (#47564695)
But you don't have to add a docstring. Cases like this are worse than no docstring at all, because it wastes the reader's time.

If you add one, at least make the effort to provide some useful information. For example which is more severe: higher or lower numbers.

Re:Show HN: Create a full language server in Go with 3.17 sp... by rumno0 on Sunday March 29, 2026 @12:39PM (#47564721)
I disagree - you should have docstring and I don't think this is worse by having it... its just not ideal
Re:Show HN: Create a full language server in Go with 3.17 sp... by hrmtst93837 on Sunday March 29, 2026 @02:34PM (#47565822)
Boilerplate docstrings are lint that spreads, and stale ones are worse, I've seen sevreity fields documented less clearly than the code they annotate.
Re:Show HN: Create a full language server in Go with 3.17 sp... by maleldil on Sunday March 29, 2026 @05:51PM (#47567773)
Every public item should have a docstring, even if it's just to indicate that there's nothing special about the item.