Go-Spring 是一个由众多子项目组成的大型生态。建议大家为这个总览仓库点亮 ⭐,这样能够更直观地展示 Go-Spring 的整体价值。
Go-Spring is a large ecosystem with many sub-projects. We recommend starring this overview repository so that the full value of Go-Spring can be more clearly recognized.
Go-Spring 是对传统 Go 项目开发痛点的一次有力回应。它借鉴了 Java 社区 Spring / Spring Boot 的成功经验,以依赖注入和自动配置为核心基础,把“开箱即用”设为首要目标。同时,它坚持 Go 社区简洁高效的哲学,融合了代码生成等优秀理念,在保持轻量与灵活的前提下,带来全新的开发体验。Go-Spring 不仅降低了项目搭建的复杂度,更为 Go 应用开发提供了里程碑式的突破。
Go-Spring is a bold response to the challenges of traditional Go project development. Inspired by the success of Spring and Spring Boot in the Java community, it builds on dependency injection and auto-configuration as its foundation, with “out-of-the-box” usability as a top priority. At the same time, it stays true to Go’s philosophy of simplicity and efficiency, incorporating ideas like code generation to deliver a fresh development experience. Go-Spring not only reduces project setup complexity but also represents a milestone breakthrough for Go application development.
-
开箱即用 & 无侵入设计 (Out-of-the-box & Non-intrusive Design)
提供即插即用的能力,不强制框架结构,让开发者专注于业务逻辑。
Works immediately without enforcing rigid framework structures, letting developers focus on business logic. -
依赖注入与自动装配 (Dependency Injection & Auto-configuration)
借鉴 Spring 的 Starter 机制,实现灵活的依赖管理与自动配置,支撑开箱即用体验。
Inspired by Spring’s Starter mechanism, it enables flexible dependency management and automatic setup to support an out-of-the-box experience. -
统一的基础设施框架 (Unified Infrastructure Frameworks)
提供可扩展的配置系统与日志系统,为依赖注入和自动装配打下坚实基础。
Provides extensible configuration and logging systems that serve as the foundation for DI and auto-configuration. -
模块化项目脚手架 (Modular Project Scaffolding)
基于 modulith 模块化理念,快速生成项目结构,提升工程组织性与可维护性。
Generates project structures based on the modulith modularization concept, improving organization and maintainability. -
IDLs-First 设计理念 (IDLs-First Philosophy)
采用现代化 IDL 语法,支持可空、嵌入、模板等特性,推动契约驱动的开发模式。
Adopts modern IDL syntax with support for nullable types, embedding, templates, and more—promoting contract-first development. -
多协议代码生成 (Multi-protocol Code Generation)
内置代码生成工具,支持 HTTP、gRPC、Thrift 等多种协议,减少重复工作。
Built-in code generators support HTTP, gRPC, Thrift, and other protocols, reducing repetitive work. -
抽象化运行模型 (Abstracted Runtime Models)
通过 Runner、Job、Server 三种核心模型,统一抽象多种服务形态,简化扩展与集成。
Introduces three unified models—Runner, Job, Server—to simplify integration and support multiple service types. -
丰富的组件生态 (Rich Component Ecosystem)
提供 MySQL、Redis 等常用中间件的 Starter,真正做到即插即用。
Provides ready-to-use Starters for common middleware like MySQL and Redis. -
无缝测试集成 (Seamless Testing Integration)
与go test
深度集成,提供简洁高效的单元测试支持。
Deeply integrates withgo test
to deliver simple yet powerful unit testing capabilities.
模块名 Module Name |
描述 Description |
---|---|
go-spring :: log | 前后端统一的日志库 Unified front-end and back-end log |
spring-base :: assert | 用于 Go 单测的断言库 An assertion library for Go unit tests |
spring-core | 核心项目 Core project |
gs-mock | 现代化的、类型安全的 Go 语言 mocking 库 A modern, type-safe mocking library for Go |
starter-gorm-mysql | gorm mysql 启动器 Starter for gorm with mysql |
starter-redigo | redigo 启动器 Starter for redigo |
starter-go-redis | go-redis 启动器 Starter for go-redis |
gs-http-gen | 基于 IDL 的 HTTP 代码生成工具 HTTP code generation tool based on IDL files |
gs | Go-Spring 工具管理器 Go-Spring Tools Manager |
gs-init | 创建新项目的工具 Create new projects |
gs-add | 为项目添加新组件的工具 Add new components |
gs-gen | 根据 IDL 文件生成 Go 服务端代码 Generate go server code based on IDL files |
skeleton | 实践 modulith 的项目骨架 Modulith practice project skeleton |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/go-spring/gs/HEAD/install.sh)"
- 创建项目。Create a project.
gs init --module my-git/my-group/my-module
- 运行程序。 Run the program.
go run main.go
如何成为贡献者?提交有意义的 PR 或者需求,并被采纳。
How to become a contributor? Submit meaningful PRs or feature requests, and have them accepted.
![]() |
![]() |
QQ群号: 721077608 | 公众号: GoSpring实战 |
为了推动 Go-Spring 的持续发展,我们诚挚邀请您支持本项目。您的捐赠将帮助我们更快地迭代功能、完善生态,并壮大社区力量。
To drive the continuous growth of Go-Spring, we warmly invite your support. Your donation will help us iterate faster, improve the ecosystem, and strengthen the community.
Thanks to JetBrains' IntelliJ IDEA product for providing a convenient and efficient code editing and testing environment.
The Go-Spring is released under version 2.0 of the Apache License.