spf13/cast
safe and easy casting from one type to another in Go observed · 2026-08-28
Health v2 · maintenance only
71/100
- Activity 77
- Release rhythm 47
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 29
- age_days: 4535
- days_rel: 359
- days_push: 143
- n_releases_24m: 6
Adoption not part of the score
3981 stars · 335 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
Cast is a Go library providing safe and consistent type conversion functions, such as converting interfaces, strings, and numbers between Go types. It was developed for Hugo and is especially useful when handling dynamic data from untyped formats like YAML, TOML, or JSON.
Use cases
- convert interface{} values to concrete Go types safely
- parse dynamic YAML/TOML/JSON data into typed Go values
- convert numbers to strings and strings to ints without panicking
- handle dynamic content in Go web applications
- get zero values or errors for failed type conversions
When to choose
- you work with interface{} values from untyped data formats like YAML, TOML, or JSON
- you need non-panicking type conversions with optional error reporting
- you want consistent, intelligent conversion behavior across a codebase
When to avoid
- you only need simple type assertions on known types
- you need strict parsing with detailed error messages for malformed input
- your project does not use Go
Facets
library · maturity stable
serialization developer-tools developer-tools programming-languages go cross-platform type-conversion casting dynamic-data configuration-parsing
1 source
- readme: https://github.com/spf13/cast · fetched 2026-08-28 · 2c582f7ed996
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| spf13/cast | main | 71 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem