-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linted
- Loading branch information
Showing
5 changed files
with
96 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
api-raml/ | ||
*article-json/ | ||
*article-json*/ | ||
validate-article-json | ||
linux-amd64* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module validate-article-json | ||
|
||
go 1.20 | ||
go 1.21 | ||
|
||
require ( | ||
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
cmd="$1" | ||
|
||
if test ! "$cmd"; then | ||
echo "command required." | ||
echo | ||
echo "available commands:" | ||
echo " build build project" | ||
echo " release build project for distribution" | ||
echo " update-deps update project dependencies" | ||
exit 1 | ||
fi | ||
|
||
shift | ||
rest=$* | ||
|
||
if test "$cmd" = "build"; then | ||
# CGO_ENABLED=0 skips CGO and linking against glibc to build static binaries. | ||
# -v 'verbose' | ||
CGO_ENABLED=0 go build \ | ||
-v | ||
exit 0 | ||
|
||
elif test "$cmd" = "release"; then | ||
# GOOS is 'Go OS' and is being explicit in which OS to build for. | ||
# CGO_ENABLED=0 skips CGO and linking against glibc to build static binaries. | ||
# ld -s is 'disable symbol table' | ||
# ld -w is 'disable DWARF generation' | ||
# -trimpath removes leading paths to source files | ||
# -v 'verbose' | ||
# -o 'output' | ||
GOOS=linux CGO_ENABLED=0 go build \ | ||
-ldflags="-s -w" \ | ||
-trimpath \ | ||
-v \ | ||
-o linux-amd64 | ||
sha256sum linux-amd64 > linux-amd64.sha256 | ||
echo --- | ||
echo "wrote linux-amd64" | ||
echo "wrote linux-amd64.sha256" | ||
exit 0 | ||
|
||
elif test "$cmd" = "update-deps"; then | ||
# -u 'update modules [...] to use newer minor or patch releases when available' | ||
go get -u | ||
go mod tidy | ||
./manage.sh build | ||
exit 0 | ||
|
||
# ... | ||
|
||
fi | ||
|
||
echo "unknown command: $cmd" | ||
exit 1 |