pre-hashed strings for fast comparison
Find a file
Julia Johannesen 0f4657cdfe
All checks were successful
CI / Test (push) Successful in 25s
CI / Lint (push) Successful in 27s
CI / Release (push) Successful in 21s
fix: remove double https
2026-10-01 18:32:14 -04:00
.forgejo/workflows feat: Automated releases 2026-10-01 17:44:47 -04:00
.releaserc.json feat: Automated releases 2026-10-01 17:44:47 -04:00
atom.go chore: Initial commit 2026-10-01 16:04:28 -04:00
atom_test.go fix: Resolve mutex issue and add tests 2026-10-01 18:23:12 -04:00
bits.go chore: Initial commit 2026-10-01 16:04:28 -04:00
errors.go chore: Initial commit 2026-10-01 16:04:28 -04:00
go.mod fix: Resolve mutex issue and add tests 2026-10-01 18:23:12 -04:00
go.sum fix: Resolve mutex issue and add tests 2026-10-01 18:23:12 -04:00
LICENSE.md chore: Initial commit 2026-10-01 16:04:28 -04:00
namespaceatom.go fix: Resolve mutex issue and add tests 2026-10-01 18:23:12 -04:00
README.md fix: remove double https 2026-10-01 18:32:14 -04:00
registry.go fix: Resolve mutex issue and add tests 2026-10-01 18:23:12 -04:00

⚛️ Atom

Made with love by Bliss Town Trans rights Go Reference Semantic Release for Go

This package represents a simple concept with many names- a pre-hashed string for faster comparisons. In functional programming languages, particularly Lisps, these are often referred to as "atoms", and even have special syntax in the form :foo, where foo is the string to hash at compile time. Some languages also refer to this concept as "symbols" or "quarks".

Examples

myAtom := atom.New("foo")
fmt.Println(myAtom) // prints "foo"

mySecondAtom := atom.New("bar")
fmt.Println(mySecondAtom) // prints "bar"

myThirdAtom := atom.New("foo")
fmt.Println(myThirdAtom) // prints "foo"
fmt.Println(myAtom == myThirdAtom) // prints "true"

Stability

The bit layout of atoms created by this package is currently unstable and may change in future versions, until v1.0.0 is released, at which point the layout will be frozen and only backwards-compatible changes will be allowed.