首页
注册
登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请
登录
The Go Programming Language
›
http://golang.org/
›
Go Playground
Go Projects
›
Revel Web Framework
广告
V2EX
›
Go 编程语言
朋友们:你们 go 项目中, mysql 数据表里的 int、smallint、mediumint,会映射成 go 里的哪个 int 类型呢? (int、int32、int64)
inSpring
·
10 天前
· 1343 次点击
MySQL
Go
int
4 条回复
•
2025-05-28 22:15:55 +08:00
1
flat
10 天前
gorm gen 自动生成
2
w568w
10 天前
int -> int32
smallint -> int16
mediumint -> int32
任何涉及存储结构的数据,不要用 int ,是不定长的。
3
realpg
10 天前
int8/uint8 int16/uint16 int32/uint32 int64/uint64 都会用
根据实际不过度使用内存
4
gitrebase
10 天前
反正别映射为 int8 ,int8 是 byte 的别名,经常遇到坑
关于
·
帮助文档
·
博客
·
API
·
FAQ
·
实用小工具
·
1361 人在线
最高记录 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 21ms ·
UTC 17:28
·
PVG 01:28
·
LAX 10:28
·
JFK 13:28
Developed with
CodeLauncher
♥ Do have faith in what you're doing.
❯