Skip to content

Commit a7e28f2

Browse files
authored
feat(internal/carver): add tooling to help carve out sub-modules (#4417)
1 parent e5df035 commit a7e28f2

File tree

8 files changed

+696
-0
lines changed

8 files changed

+696
-0
lines changed

internal/carver/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# carver
2+
3+
This is a tool used to carve out new modules in cloud.google.com/go.
4+
5+
## Usage
6+
7+
```bash
8+
go run cmd/main.go \
9+
-parent=/path/to/google-cloud-go \
10+
-child=asset \
11+
-repo-metadata=/path/to/google-cloud-go/internal/.repo-metadata-full.json
12+
```

internal/carver/cmd/_CHANGES.md.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Changes
2+
3+
## v0.1.0
4+
5+
This is the first tag to carve out {{.Package}} as its own module. See
6+
[Add a module to a multi-module repository](https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository).

internal/carver/cmd/_README.md.txt

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# {{.Name}}
2+
3+
[![Go Reference](https://pkg.go.dev/badge/{{.ImportPath}}.svg)](https://pkg.go.dev/{{.ImportPath}})
4+
5+
Go Client Library for {{.Name}}.
6+
7+
## Install
8+
9+
```bash
10+
go get {{.ImportPath}}
11+
```
12+
13+
## Stability
14+
15+
The stability of this module is indicated by SemVer.
16+
17+
However, a `v1+` module may have breaking changes in two scenarios:
18+
19+
* Packages with `alpha` or `beta` in the import path
20+
* The GoDoc has an explicit stability disclaimer (for example, for an experimental feature).
21+
22+
## Go Version Support
23+
24+
See the [Go Versions Supported](https://github.com/googleapis/google-cloud-go#go-versions-supported)
25+
section in the root directory's README.
26+
27+
## Authorization
28+
29+
See the [Authorization](https://github.com/googleapis/google-cloud-go#authorization)
30+
section in the root directory's README.
31+
32+
## Contributing
33+
34+
Contributions are welcome. Please, see the [CONTRIBUTING](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/master/CONTRIBUTING.md)
35+
document for details.
36+
37+
Please note that this project is released with a Contributor Code of Conduct.
38+
By participating in this project you agree to abide by its terms. See
39+
[Contributor Code of Conduct](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/master/CONTRIBUTING.md#contributor-code-of-conduct)
40+
for more information.
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright {{.Year}} Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// This file, and the {{.RootMod}} import, won't actually become part of
16+
// the resultant binary.
17+
// +build modhack
18+
19+
package {{.Package}}
20+
21+
// Necessary for safely adding multi-module repo. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository
22+
import _ "{{.RootMod}}"

0 commit comments

Comments
 (0)