Skip to content
Snippets Groups Projects
Commit 90e68cb7 authored by gjahn's avatar gjahn
Browse files

Rework README and add note on building static vs. dynamic binary

parent 612b5e98
No related branches found
No related tags found
No related merge requests found
...@@ -42,6 +42,7 @@ $(BIN_DIR)/artifact.bin: ...@@ -42,6 +42,7 @@ $(BIN_DIR)/artifact.bin:
.PHONY: build-linux .PHONY: build-linux
build-linux: export GOOS := linux build-linux: export GOOS := linux
build-linux: export GOARCH := amd64 build-linux: export GOARCH := amd64
build-linux: export CGO_ENABLED := 0
build-linux: $(BIN_DIR)/artifact.bin build-linux: $(BIN_DIR)/artifact.bin
......
Webservice Webservice
========== ==========
A Go-based simple web service meant to be the subject for any tutorial A Go-based simple web service meant to be the subject of any tutorial
or maybe even the project work. or even used the project work.
__Prerequisites:__ #### Prerequisites:
* Go toolchain (install via system package manager or [by hand](https://go.dev/doc/install)) * Go toolchain (install via system package manager or [by hand](https://go.dev/doc/install))
__Primary interactions:__ #### Build
1. Install dependencies: `go get -t ./...` 1. Install dependencies: `go get -t ./...`
2. Run locally: `go run .` 2. Run locally: `go run .`
3. Execute unit tests: `go test -race -v ./...` 3. Execute unit tests: `go test -race -v ./...`
4. Build artifact: `go build -o ./artifact.bin ./*.go` 4. Build artifact: `go build -o ./artifact.bin ./*.go`
To build for another platform, set `GOOS` and `GOARCH`. For more details, To build for another platform, set `GOOS` and `GOARCH`. To yield a static binary (fully
please refer to the `Makefile`. self-contained, no dynamic linking) set `CGO_ENABLED=0`. For more details, please refer
to the [Makefile](./Makefile).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment