Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This only happens for literal values. Mixing up variables of different types will result in a type error.

When you write 42 in Go, it’s not an int32 or int64 or some more specific type. It’s automatically inferred to have the correct type. This applies even for user-defined numeric types.



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: