Skip to content

Latest commit

 

History

History
36 lines (31 loc) · 813 Bytes

File metadata and controls

36 lines (31 loc) · 813 Bytes

go-example

What is it?

这是一个 golang 的练习库。用于熟悉一些 golang 的机制。 基于 cobra,和 Go by Example

How to use?

# list all example
go run main.go list

# run a certain example
go run main.go run <GoExample>

TODO: add doc for certain go example

How to build?

./scripts/build.sh

you may find executable file in (project path)/output/

How to develop?

  1. create a path for your example
mkdir pkg/goexpl/foo/foo.go
  1. Implement your owner GoExample
    a. Implement interface GoExample
    b. define a name in pkg/common/constats
    c. add your go example in cmd.AllGoExample
    you may refer to former commit.
  2. run for test
go run main.go run foo