GO-0003

原文

https://golang.google.cn/doc/

Developing modules

Developing and publishing modules

You can collect related packages into modules, then publish the modules for other developers to use. This topic gives an overview of developing and publishing modules.

Module release and versioning workflow

When you develop modules for use by other developers, you can follow a workflow that helps ensure a reliable, consistent experience for developers using the module. This topic describes the high-level steps in that workflow.

Managing module source

When you're developing modules to publish for others to use, you can help ensure that your modules are easier for other developers to use by following the repository conventions described in this topic.

Organizing a Go module

What is the right way to organize the files and directories in a typical Go project? This topic discusses some common layouts depending on the kind of module you have.

Developing a major version update

A major version update can be very disruptive to your module's users because it includes breaking changes and represents a new module. Learn more in this topic.

Publishing a module

When you want to make a module available for other developers, you publish it so that it's visible to Go tools. Once you've published the module, developers importing its packages will be able to resolve a dependency on the module by running commands such as go get.

Module version numbering

A module's developer uses each part of a module's version number to signal the version’s stability and backward compatibility. For each new release, a module's release version number specifically reflects the nature of the module's changes since the preceding release.

以下是对您提供的 IT 技术英文文档 “Developing modules” 部分的完整处理,严格遵循您此前指定的格式要求。


1. 全文专业翻译(英译汉)

开发模块
开发与发布模块
您可以将相关的包组织成模块,然后将这些模块发布供其他开发者使用。本主题概述了模块的开发与发布流程。

模块发布与版本控制工作流
当您开发供其他开发者使用的模块时,可遵循一套工作流,以确保使用者获得可靠且一致的体验。本主题描述了该工作流中的高层步骤。

管理模块源码
在开发供他人使用的模块时,遵循本文所述的代码仓库约定,有助于提升模块对其他开发者的易用性。

组织 Go 模块
一个典型的 Go 项目,其文件和目录应如何组织?本主题根据模块类型的不同,讨论了几种常见的项目布局方式。

开发主版本更新
主版本更新可能对模块用户造成较大影响,因为它包含破坏性变更,并代表一个全新的模块。更多内容请参见本主题。

发布模块
当您希望让其他开发者能够使用您的模块时,需将其发布,使其对 Go 工具可见。一旦模块发布成功,开发者在导入其包时,即可通过运行诸如 go get 等命令解析对该模块的依赖。

模块版本编号
模块开发者通过版本号的每一部分来表明该版本的稳定性与向后兼容性。每次新发布时,模块的版本号都会明确反映自上一版本以来所做变更的性质。


2. 词汇表梳理

本次共收获单词:37 个

序号 单词 词性 音标 拼读 释义
1 Developing 动词(develop 的现在分词) /dɪˈveləpɪŋ/ /dɪˈveləpɪŋ/ De-vel-op-ing 迪维洛平 开发(软件、模块等)
2 Publishing 动词(publish 的现在分词) /ˈpʌblɪʃɪŋ/ /ˈpʌblɪʃɪŋ/ Pub-lish-ing 帕布利兴 发布(代码、模块、文档等)
3 Collect 动词 /kəˈlekt/ /kəˈlekt/ Col-lect 卡莱克特 收集,聚合
4 Related 形容词 /rɪˈleɪtɪd/ /rɪˈleɪtɪd/ Re-lat-ed 瑞雷踢德 相关的
5 Overview 名词 /ˌəʊvəˈvjuː/ /ˌoʊvərˈvjuː/ O-ver-view 欧沃维尤 概述,概览
6 Release 名词 / 动词 /rɪˈliːs/ /rɪˈliːs/ Re-lease 瑞利斯 (软件)发布;释放
7 Versioning 名词(version 的动名词) /ˈvɜːʃənɪŋ/ /ˈvɜːrʒənɪŋ/ Ver-sion-ing 沃仁兴 版本控制,为软件分配版本号的过程
8 Workflow 名词 /ˈwɜːkfləʊ/ /ˈwɜːrkfloʊ/ Work-flow 沃克弗洛 工作流,完成某项任务的标准操作流程
9 Ensure 动词 /ɪnˈʃʊə(r)/ /ɪnˈʃʊr/ En-sure 因硕尔 确保,保证
10 Reliable 形容词 /rɪˈlaɪəbl/ /rɪˈlaɪəbl/ Re-li-a-ble 瑞莱布 可靠的
11 Consistent 形容词 /kənˈsɪstənt/ /kənˈsɪstənt/ Con-sist-ent 肯西斯滕特 一致的
12 High-level 形容词 /ˌhaɪ ˈlevl/ /ˌhaɪ ˈlevl/ High-lev-el 海莱维尔 高层的,抽象的(非细节层面)
13 Managing 动词(manage 的现在分词) /ˈmænɪdʒɪŋ/ /ˈmænɪdʒɪŋ/ Man-ag-ing 曼尼金 管理(源码、依赖、项目等)
14 Repository 名词 /rɪˈpɒzətri/ /rɪˈpɑːzətɔːri/ Re-pos-i-to-ry 瑞波泽托瑞 (代码)仓库,如 Git 仓库
15 Conventions 名词(convention 的复数) /kənˈvenʃnz/ /kənˈvenʃənz/ Con-ven-tions 肯文申兹 约定,惯例
16 Organizing 动词(organize 的现在分词) /ˈɔːɡənaɪzɪŋ/ /ˈɔːrɡənaɪzɪŋ/ Or-gan-iz-ing 奥根艾兴 组织(文件、目录结构等)
17 Typical 形容词 /ˈtɪpɪkl/ /ˈtɪpɪkl/ Typ-i-cal 踢皮扣 典型的
18 Layout 名词 /ˈleɪaʊt/ /ˈleɪaʊt/ Lay-out 雷奥特 布局,结构(指目录或文件组织方式)
19 Disruptive 形容词 /dɪsˈrʌptɪv/ /dɪsˈrʌptɪv/ Dis-rup-tive 迪斯瑞普踢夫 破坏性的,造成中断的
20 Breaking 形容词(break 的现在分词作定语) /ˈbreɪkɪŋ/ /ˈbreɪkɪŋ/ Break-ing 布雷金 (变更)破坏向后兼容性的
21 Update 名词 / 动词 /ʌpˈdeɪt/ /ʌpˈdeɪt/ Up-date 阿普德特 更新
22 Available 形容词 /əˈveɪləbl/ /əˈveɪləbl/ A-vail-a-ble 阿维莱布 可用的
23 Visible 形容词 /ˈvɪzəbl/ /ˈvɪzəbl/ Vis-i-ble 维兹布 可见的
24 Importing 动词(import 的现在分词) /ɪmˈpɔːtɪŋ/ /ɪmˈpɔːrtɪŋ/ Im-port-ing 因波亭 导入(包或模块)
25 Resolve 动词 /rɪˈzɒlv/ /rɪˈzɑːlv/ Re-solve 瑞索尔夫 解析(依赖关系)
26 Dependency 名词 /dɪˈpendənsi/ /dɪˈpendənsi/ De-pen-den-cy 迪潘登西 依赖,一个模块对另一个模块的依赖关系
27 Numbering 名词(number 的动名词) /ˈnʌmbərɪŋ/ /ˈnʌmbərɪŋ/ Num-ber-ing 南波亭 编号,赋予数字标识
28 Developer 名词 /dɪˈveləpə(r)/ /dɪˈveləpər/ De-vel-op-er 迪维洛珀 开发者
29 Signal 动词 /ˈsɪɡnəl/ /ˈsɪɡnəl/ Sig-nal 西格纳尔 表明,传达(某种信息)
30 Stability 名词 /stəˈbɪləti/ /stəˈbɪləti/ Sta-bil-i-ty 斯塔比利替 稳定性
31 Backward 形容词 / 副词 /ˈbækwəd/ /ˈbækwərd/ Back-ward 拜克沃德 向后的;(兼容性)向后兼容的
32 Compatibility 名词 /kəmˌpætəˈbɪləti/ /kəmˌpætəˈbɪləti/ Com-pat-i-bil-i-ty 康帕提比里替 兼容性
33 Reflect 动词 /rɪˈflekt/ /rɪˈflekt/ Re-flect 瑞弗莱克特 反映,体现
34 Nature 名词 /ˈneɪtʃə(r)/ /ˈneɪtʃər/ Na-ture 内切尔 性质,本质
35 Preceding 形容词 /prɪˈsiːdɪŋ/ /prɪˈsiːdɪŋ/ Pre-ced-ing 普里西丁 先前的,前述的
36 Bump 动词 / 名词 /bʌmp/ /bʌmp/ Bump 邦普 (版本号)递增,提升
posted @ 2026-01-03 13:04  红尘过客2022  阅读(32)  评论(0)    收藏  举报