gonew

command module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2025 License: BSD-3-Clause Imports: 15 Imported by: 0

README

gonew

本專案為 golang.org/x/tools/cmd/[email protected] 的改良版本

將模板專案複製方式由 go mod downloa 改為直接使用 git clone

避免 Go module 處理 private repository 及 go mod cache 等相關問題

提供更直接且彈性的專案初始化流程

Example

To install gonew:

go install github.com/cody0704/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

Ref

Documentation

Overview

Gonew starts a new Go module by cloning a template repository.

Usage:

gonew src repo[@version] [dstmod [dir]]

Gonew clones the src repo, 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 github.com/your-username/gonew@latest

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

gonew github.com/example/hello your.domain/myprog

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

gonew github.com/rsc/quote

Directories

Path Synopsis
internal
edit
Package edit implements buffered position-based editing of byte slices.
Package edit implements buffered position-based editing of byte slices.

Jump to

Keyboard shortcuts

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