WeSearch

Camellia: A Small Go Linter for Camel-Case Abbreviations

·2 min read · 0 reactions · 0 comments · 16 views
#go#linting#programming
Camellia: A Small Go Linter for Camel-Case Abbreviations
TL;DR · WeSearch summary

Camellia is a Go linter designed to address the naming convention of camel-case abbreviations in Go code. It promotes a consistent style by suggesting the use of camel case for identifiers that contain abbreviations, making code easier to read. The tool is narrow in scope, focusing on enforcing this naming choice without altering entire projects or style guides.

Key facts
Original article
DEV.to (Top)
Read full at DEV.to (Top) →
Opening excerpt (first ~120 words) tap to expand

try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 98161) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Kaitian Xie Posted on May 16 Camellia: A Small Go Linter for Camel-Case Abbreviations #go #linting Go code has a long-running naming habit around initialisms: ID, URL, HTTP, API, and friends often stay fully capitalized inside identifiers. That gives you names like UserID, ParseURL, HTTPClient, and APIError. I understand the convention, but I do not like how it reads. My preference is simpler: treat abbreviations like normal words when they are part of a mixed-case identifier.

Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Threads WhatsApp Bluesky Mastodon Email

Discussion

0 comments

More from DEV.to (Top)