Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

jbrudvik/gmc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gmc (Go mod create)

gmc (Go mod create) is a CLI that creates Go modules

⚠️ gmc is now in archive-mode, and is no longer actively maintained. Refer to these instructions instead: https://github.com/jbrudvik/new

Build Go Reference

Usage

Create a module as Git repository

$ gmc -g github.com/jbrudvik/mymodule
Creating Go module: github.com/jbrudvik/mymodule
- Created directory: mymodule
- Initialized Go module
- Created file     : mymodule/main.go
- Created file     : mymodule/.gitignore
- Initialized Git repository
- Created file     : mymodule/README.md
- Committed all files to Git repository
- Added remote for Git repository: git@github.com:jbrudvik/mymodule.git

Finished creating Go module: github.com/jbrudvik/mymodule

Next steps:
- Change into module's directory: $ cd mymodule
- Run module: $ go run .
- Create remote Git repository git@github.com:jbrudvik/mymodule.git: https://github.com/new
- Push to remote Git repository: $ git push -u origin main
- Start coding: $ vim .

Show help

$ gmc -h
NAME:
   gmc - (Go mod create) creates Go modules

USAGE:
   gmc [global options] [module name]

VERSION:
   vX.Y.Z

DESCRIPTION:
   `gmc [module name]` creates a directory containing:
   - Go module metadata: go.mod
   - A place to start writing code: main.go
   - A .gitignore file

   This module can be immediately run:

       $ go run .
       hello, world!

   Optionally, the directory can also include:
   - Git repository setup with .gitignore, README.md

   More information: https://github.com/jbrudvik/gmc

GLOBAL OPTIONS:
   --git, -g      create as Git repository (default: false)
   --quiet, -q    silence output (default: false)
   --help, -h     show help (default: false)
   --version, -v  print the version (default: false)

Install

Required dependencies

  • Go 1.18
  • goimports: $ go install golang.org/x/tools/cmd/goimports@latest
  • Git (for Git-related features)

Install gmc

$ go install github.com/jbrudvik/gmc@latest