int64 is Go’s signed integer type with exactly 64 bits. It is the largest native integer type and suits values requiring the greatest range, including timestamps, file offsets, and size limits. section 3.1.1
Choose int64 when its range or API compatibility justifies it:
- Use it for values passed frequently to functions that accept int64. section 3.1.1
- Prefer int for general-purpose integers unless the domain requires int64; convert from int when needed. section 3.1.1
- Avoid choosing smaller integer types merely to save memory; benchmark and profile before treating representation size as a performance problem. section 3.1.1
