Skip to content


Browse files Browse the repository at this point in the history
feat(internal/carver): add tooling to help carve out sub-modules (#4417)
  • Loading branch information
codyoss committed Jul 26, 2021
1 parent e5df035 commit a7e28f2
Show file tree
Hide file tree
Showing 8 changed files with 696 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/carver/
@@ -0,0 +1,12 @@
# carver

This is a tool used to carve out new modules in

## Usage

go run cmd/main.go \
-parent=/path/to/google-cloud-go \
-child=asset \
6 changes: 6 additions & 0 deletions internal/carver/cmd/
@@ -0,0 +1,6 @@
# Changes

## v0.1.0

This is the first tag to carve out {{.Package}} as its own module. See
[Add a module to a multi-module repository](
40 changes: 40 additions & 0 deletions internal/carver/cmd/
@@ -0,0 +1,40 @@
# {{.Name}}

[![Go Reference]({{.ImportPath}}.svg)]({{.ImportPath}})

Go Client Library for {{.Name}}.

## Install

go get {{.ImportPath}}

## Stability

The stability of this module is indicated by SemVer.

However, a `v1+` module may have breaking changes in two scenarios:

* Packages with `alpha` or `beta` in the import path
* The GoDoc has an explicit stability disclaimer (for example, for an experimental feature).

## Go Version Support

See the [Go Versions Supported](
section in the root directory's README.

## Authorization

See the [Authorization](
section in the root directory's README.

## Contributing

Contributions are welcome. Please, see the [CONTRIBUTING](
document for details.

Please note that this project is released with a Contributor Code of Conduct.
By participating in this project you agree to abide by its terms. See
[Contributor Code of Conduct](
for more information.
22 changes: 22 additions & 0 deletions internal/carver/cmd/_tidyhack_tmpl.txt
@@ -0,0 +1,22 @@
// Copyright {{.Year}} Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.

// This file, and the {{.RootMod}} import, won't actually become part of
// the resultant binary.
// +build modhack

package {{.Package}}

// Necessary for safely adding multi-module repo. See:
import _ "{{.RootMod}}"

0 comments on commit a7e28f2

Please sign in to comment.