gonew

command
v0.23.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2024 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Gonew starts a new Go module by copying a template module.

Usage:

gonew srcmod[@version] [dstmod [dir]]

Gonew makes a copy of the srcmod module, changing its module path to dstmod. It writes that new module to a new directory named by dir. If dir already exists, it must be an empty directory. If dir is omitted, gonew uses ./elem where elem is the final path element of dstmod.

This command is highly experimental and subject to change.

Example

To install gonew:

go install golang.org/x/tools/cmd/gonew@latest

To clone the basic command-line program template golang.org/x/example/hello as your.domain/myprog, in the directory ./myprog:

gonew golang.org/x/example/hello your.domain/myprog

To clone the latest copy of the rsc.io/quote module, keeping that module path, into ./quote:

gonew rsc.io/quote

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL