CodeGym
AI Academy
促销
CodeGym University
学习
课程
任务
调查 & 测验
游戏
帮助
日程
社区
Users
论坛
聊天
文章
成功故事
动态
评价
订阅
浅色主题

课时

  • 评论
  • 关于我们
开始
开始学习
立即开始学习
  • 我的进度
  • 课程
  • 任务地图
  • 课程
  • Go Modules 从零开始: go mod init、 go.mod 和 go.sum

    Go SELF
    等级 35,课时 0
    从实践角度讲解 Go 的模块系统:什么是模块和包,如何选择 module path,通过 go mod init 创建项目,阅读 go.mod 文件中的关键指令( module、 go、 require),通过模块前缀导入自己的包,以及为什么 go.sum 对依赖项的可复现性和完整性校验很重要。
    可用
  • go mod tidy 和 go get — 版本管理

    Go SELF
    等级 35,课时 1
    我们讲解 Go 模块系统中的两个关键命令: go get(选择并固定模块版本)和 go mod tidy(根据实际导入同步依赖)。我们会了解 go.mod/ go.sum 的工作方式, // indirect 标记从何而来,包导入与模块路径有什么区别,以及以 todoapp 项目为例看看依赖的生命周期。
    可用
  • replace: local replacements, risks, and when it is appropriate

    Go SELF
    等级 35,课时 2
    We discuss the replace directive in go.mod: why it is needed for local verification of fixes before a release, how the two replacement forms work (to a local path and to another module path/version), how to connect a neighboring module through replace, and why this can easily turn into “works only on my machine” (CI, reproducibility, limitations in some commands). At the end, there is a checklist for when replace is appropriate, and common mistakes.
    可用
  • Go 中的 vendor/:何时需要以及会改变什么

    Go SELF
    等级 35,课时 3
    我们来讲解 Go 中的 vendor/ 是什么,以及它如何影响构建:工具 go 从哪里获取导入的源代码,vendoring 与 module cache 以及 replace 指令有何不同,目录如何通过 go mod vendor 生成, modules.txt 中保存了什么,什么时候 vendor/ 能派上用场(离线/封闭环境/审计),什么时候又会变成多余负担,以及团队最常犯哪些错误。
    可用
  • go.work — workspace mode

    Go SELF
    等级 35,课时 4
    我们来解析 Go 中的 workspace mode:为什么需要 go.work 文件, use 指令如何把多个模块“粘”在一起用于本地开发,为什么这比在 go.mod 中临时使用 replace 更好,如何通过 go work init 和 go work use 创建并填充 workspace,如何通过 goWORK 诊断是否启用了该模式,以及什么时候适合运行 go work sync。
    可用
Learn
  • 注册
  • Java 课程
  • 任务帮助
  • 定价
  • Java 语法
社区
  • 用户
  • 文章
  • 论坛
  • 聊天
  • 成功故事
  • 动态
  • 联盟计划
Company
  • 关于我们
  • 联系方式
  • 评价
  • 媒体中心
  • CodeGym for EDU
  • 常见问题
  • 支持
CodeGymCodeGym 是一个从零开始学习 Java 编程的在线课程。该课程是初学者掌握 Java 的完美方式。它包含 1200+ 个带即时验证的任务,以及必要的 Java 基础理论。为了帮助你在学习中取得成功,我们实现了一系列激励功能:测验、编码项目、关于高效学习的内容,以及 Java 开发者职业相关内容。
关注我们
界面语言
English Deutsch Español हिन्दी Français Português Polski বাংলা
简体中文
मराठी தமிழ் Italiano Bahasa Indonesia 繁體中文 Nederlands 日本語 한국어 Bulgarian Danish Hungarian Basa Jawa Malay Norwegian Romanian Swedish Telugu Thai Українська Filipino Turkish Azərbaycan Русский Vietnamese
“程序员是培养出来的,不是天生的” © 2026 CodeGym
MastercardVisa
“程序员是培养出来的,不是天生的” © 2026 CodeGym