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
612b5e98
Commit
612b5e98
authored
1 year ago
by
gjahn
Browse files
Options
Downloads
Patches
Plain Diff
Add target to cross-compile for Linux (amd64)
Hint in readme on how to change built target platform.
parent
264d6a37
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Makefile
+6
-1
6 additions, 1 deletion
Makefile
README.md
+4
-3
4 additions, 3 deletions
README.md
with
10 additions
and
4 deletions
Makefile
+
6
−
1
View file @
612b5e98
...
...
@@ -14,7 +14,7 @@ export PATH := $(BIN_DIR):$(PATH)
export
GOMODCACHE
=
$(
LOCAL_DIR
)
/cache/go
export
GOTMPDIR
=
$(
TMP_DIR
)
/go
export
GOBIN
=
$(
BIN_DIR
)
default
:
clean install build run
...
...
@@ -39,6 +39,11 @@ $(BIN_DIR)/artifact.bin:
-o
$(
@
)
\
$(
SRC_DIR
)
/
*
.go
.PHONY
:
build-linux
build-linux
:
export GOOS := linux
build-linux
:
export GOARCH := amd64
build-linux
:
$(BIN_DIR)/artifact.bin
.PHONY
:
test
.SILENT
:
test
...
...
This diff is collapsed.
Click to expand it.
README.md
+
4
−
3
View file @
612b5e98
...
...
@@ -2,7 +2,7 @@ Webservice
==========
A Go-based simple web service meant to be the subject for any tutorial
or even the project work.
or
maybe
even the project work.
__Prerequisites:__
...
...
@@ -10,11 +10,12 @@ __Prerequisites:__
*
Go toolchain (install via system package manager or
[
by hand
](
https://go.dev/doc/install
)
)
__
Main
interactions:__
__
Primary
interactions:__
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`
For more details, please refer to the
`Makefile`
.
To build for another platform, set
`GOOS`
and
`GOARCH`
. For more details,
please refer to the
`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