Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
webservice
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DevOps (Lecture FB VI)
webservice
Commits
90e68cb7
Commit
90e68cb7
authored
1 year ago
by
gjahn
Browse files
Options
Downloads
Patches
Plain Diff
Rework README and add note on building static vs. dynamic binary
parent
612b5e98
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Makefile
+1
-0
1 addition, 0 deletions
Makefile
README.md
+7
-6
7 additions, 6 deletions
README.md
with
8 additions
and
6 deletions
Makefile
+
1
−
0
View file @
90e68cb7
...
...
@@ -42,6 +42,7 @@ $(BIN_DIR)/artifact.bin:
.PHONY
:
build-linux
build-linux
:
export GOOS := linux
build-linux
:
export GOARCH := amd64
build-linux
:
export CGO_ENABLED := 0
build-linux
:
$(BIN_DIR)/artifact.bin
...
...
This diff is collapsed.
Click to expand it.
README.md
+
7
−
6
View file @
90e68cb7
Webservice
==========
A Go-based simple web service meant to be the subject f
or
any tutorial
or
maybe even
the project work.
A Go-based simple web service meant to be the subject
o
f any tutorial
or
even used
the project work.
__
Prerequisites:
__
####
Prerequisites:
*
Go toolchain (install via system package manager or
[
by hand
](
https://go.dev/doc/install
)
)
__Primary interactions:__
#### Build
1.
Install dependencies:
`go get -t ./...`
2.
Run locally:
`go run .`
3.
Execute unit tests:
`go test -race -v ./...`
4.
Build artifact:
`go build -o ./artifact.bin ./*.go`
To build for another platform, set
`GOOS`
and
`GOARCH`
. For more details,
please refer to the
`Makefile`
.
To build for another platform, set
`GOOS`
and
`GOARCH`
. To yield a static binary (fully
self-contained, no dynamic linking) set
`CGO_ENABLED=0`
. For more details, please refer
to the
[
Makefile
](
./Makefile
)
.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment