Skip to content

Command Line Instructions to create a Hello World app for the languages passed as command arguments.

License

Notifications You must be signed in to change notification settings

ritikamotwani/Go-CLI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Command Line Instructions to create a Hello World app for the languages passed as command arguments.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published