Go搭建后台服务学习记录
资料:
1. go基础
https://juejin.im/entry/58329f84da2f600063074382
2.go的一个orm框架,但是我觉得不是非常好用,跟hibernate这些差距非常大
https://www.cnblogs.com/guhao123/p/4159688.html
3.微服务
4.Docker入门教程
http://www.docker.org.cn/book/docker/prepare-docker-5.html
5.目前为止找到最易用的Go web框架,beego
beego的开源之路
https://blog.csdn.net/RA681t58CJxsgCkJ31/article/details/79276433
PS:框架作者像阮一峰一样开源了自己写的书,在他的Github上
问题:
1.环境变量:
https://www.cnblogs.com/guhao123/p/4159688.html
https://blog.csdn.net/handsomefuhs/article/details/79687381
mac添加环境变量,基本上都是动 bash_profile,添加完环境变量后,重启终端才生效
2.报错
main.go:16:2: cannot find package "github.com/micro/examples/booking/api/hotel/proto" in any of: /usr/local/go/src/github.com/micro/examples/booking/api/hotel/proto (from $GOROOT) /Users/linge/go/src/github.com/micro/examples/booking/api/hotel/proto (from $GOPATH) main.go:17:2: cannot find package "github.com/micro/examples/booking/srv/auth/proto" in any of: /usr/local/go/src/github.com/micro/examples/booking/srv/auth/proto (from $GOROOT) /Users/linge/go/src/github.com/micro/examples/booking/srv/auth/proto (from $GOPATH) main.go:18:2: cannot find package "github.com/micro/examples/booking/srv/geo/proto" in any of: /usr/local/go/src/github.com/micro/examples/booking/srv/geo/proto (from $GOROOT) /Users/linge/go/src/github.com/micro/examples/booking/srv/geo/proto (from $GOPATH) main.go:19:2: cannot find package "github.com/micro/examples/booking/srv/profile/proto" in any of: /usr/local/go/src/github.com/micro/examples/booking/srv/profile/proto (from $GOROOT) /Users/linge/go/src/github.com/micro/examples/booking/srv/profile/proto (from $GOPATH) main.go:20:2: cannot find package "github.com/micro/examples/booking/srv/rate/proto" in any of: /usr/local/go/src/github.com/micro/examples/booking/srv/rate/proto (from $GOROOT) /Users/linge/go/src/github.com/micro/examples/booking/srv/rate/proto (from $GOPATH) main.go:11:2: cannot find package "github.com/nu7hatch/gouuid" in any of: /usr/local/go/src/github.com/nu7hatch/gouuid (from $GOROOT) /Users/linge/go/src/github.com/nu7hatch/gouuid (from $GOPATH) ../../../../go/src/github.com/micro/go-micro/broker/http_broker.go:29:2: cannot find pac
go get -u github.com/micro/go-micro package golang.org/x/text/secure/bidirule: unrecognized import path "golang.org/x/text/secure/bidirule" (https fetch: Get https://golang.org/x/text/secure/bidirule?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) package golang.org/x/text/unicode/bidi: unrecognized import path "golang.org/x/text/unicode/bidi" (https fetch: Get https://golang.org/x/text/unicode/bidi?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) package golang.org/x/text/unicode/norm: unrecognized import path "golang.org/x/text/unicode/norm" (https fetch: Get https://golang.org/x/text/unicode/norm?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)
第一个是少了包,编译不过,按照下面安装包时,会遇到国内大多数人遇到的包安装问题,即使挂vpn也无济于事,解决方法是
gopm
gopm get -g -v github.com/go-sql-driver/mysql
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 25岁的心里话
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现