Skip to content

paikend/hello-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1. Install

  1. go mod init hello-cli
  2. go get -u github.com/spf13/cobra

2. Init Project

  1. cobra-cli init
  2. cobra-cli add greetgl

3. Write a application code(update cmd/greet.go)

  1. Print Hello World
  2. Print Hello ${name}, default name is World
  3. (Print Hello ${name}, default name is World) * ${count}, default count is 1

4. Results

execute_image

5. Write the makefile

About

Example for Cobra CLI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published