oauth2授权服务器
Go to file
2025-01-02 11:54:15 +08:00
cmd Initial commit 2025-01-02 11:54:15 +08:00
internal Initial commit 2025-01-02 11:54:15 +08:00
.DS_Store Initial commit 2025-01-02 11:54:15 +08:00
.gitignore Initial commit 2025-01-02 11:54:15 +08:00
go.mod Initial commit 2025-01-02 11:54:15 +08:00
go.sum Initial commit 2025-01-02 11:54:15 +08:00
Makefile Initial commit 2025-01-02 11:54:15 +08:00
README.md Initial commit 2025-01-02 11:54:15 +08:00

项目结构

- bin # 可编译的二进制文件, 用于部署到服务器
- cmd
  - api # 业务代码, 处理请求,权限
    - main.go
- internel # 辅助代码, 处理数据库, 数据校验, 发邮件等
- migrations # sql迁移文件
- remote # 配置文件和启动脚本
- go.mod # 项目依赖, 版本号, 模块路径
- Makefile # 自动化处理任务, 审核代码, 生成二进制文件, 执行sql迁移

hello world

package main 
impot "fmt"
func main() {
  fmt.Println("hello world!")
}

执行代码

$ go run ./cmd/api # hello world!