Skip to content

Latest commit

 

History

History
68 lines (33 loc) · 1.6 KB

README.md

File metadata and controls

68 lines (33 loc) · 1.6 KB

Go-CLI

Command Line Utility to create Hello World apps.

Installation

Go

Instructions: https://golang.org/doc/install

Setting up environment variables

In your .zshrc or .bashrc file, append your system’s $PATH so that the command can be invoked from anywhere.

export PATH=${PATH}:$HOME/go/bin

Restart your terminal once to source them into your machine environment or just source ~/.zshrc.

Cobra

To install cobra, run:

go get -u github.com/spf13/cobra/cobra

You can run cobra help or just cobra to get more familiar with it.

[Reference: https://dzone.com/articles/how-to-create-a-cli-in-go-in-few-minutes]

Steps to install the project:

After cloning the repo, go to the project's directory (HelloWorld) and run:

One Time Commands:

  • go mod init HelloWorld
  • go build
  • go install HelloWorld

After editing files to run the command to reflect the new changes, run:

  • go install HelloWorld to build the new version.

This project also uses to create binary files of the hello world files in different languages: https://github.com/go-bindata/go-bindata

After adding a new file in cmd/data for a new language To install that, run:

  1. go get -u github.com/go-bindata/go-bindata/...
  2. go-bindata data/

Then install the module again.

Usage

image

Example - Run HelloWorld create NodeJS a nodeJS Hello World app gets created in the home directory.