GoForum › 🌐 V2EX
PHP 转 Go,目前有点心慌啊
Loser110 ·
2026-01-21 16:16 ·
0 次点赞 · 2 条回复
Go 跟 PHP 理念差很多啊。
比如,PHP 中返回 json ,可以就是一个 json($data) 函数搞定,
Go 得这样
helpers.JSON(w, http.StatusBadRequest, map[string]string{
"error": "error converting post data to JSON",
})
同样的功能,Go 是真啰嗦一堆
当然,go 的速度是真快,比 laravel 快 100 倍。用 podman 打包的 hello world image ,就 10M
你们有后悔 PHP 转 Go Lang 吗,怎么转变这种观念?
添加回复
你还需要 登录
后发表回复
啥都没干,怎么发帖进第二页了,可真 dictator