Skip to content

Latest commit

 

History

History
38 lines (34 loc) · 921 Bytes

README.md

File metadata and controls

38 lines (34 loc) · 921 Bytes

Golang basic project

spec

build & run

  • test command
$ GOOS=darwin GOARCH=amd64 go build -o bin/hello -v cmd/hello/main.go
$ ./bin/hello
  • install
$ make install
  • check : format, style, lint
$ make check
  • build
$ make build
  • run
$ make run

Makefile

  • usage go command : go build, go install, dep, gometalinter, ginkgo, rm, gofmt
  • make command : all, lint, install, build, build-all, run, run-cont, clean, test, test-cont
  • go build options : -ldflags, -i, -o, -v
    • -i : flag installs the packages that are dependencies of the target.
    • -v : print the names of packages as they are compiled.
    • -ldflags : arguments to pass on each go tool link invocation.