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, changing its module path to dstMod. It writes that new 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 clone the basic command-line program template rsc.io/tmp/newcmd as your.domain/myprog, in the directory ./myprog:
gonew rsc.io/tmp/newcmd your.domain/myprog
Or without having to install gonew first:
go run rsc.io/tmp/gonew@latest rsc.io/tmp/newcmd your.domain/myprog
To clone a module without renaming the module:
gonew rsc.io/tmp/quote
Click to show internal directories.
Click to hide internal directories.