Skip to content

Commit

Permalink
Use OS detection
Browse files Browse the repository at this point in the history
  • Loading branch information
vit1251 committed Dec 17, 2024
1 parent 5e08668 commit ca5052e
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Golang and Node MAY use network to download dependencies.

Common steps are:

# go build ./cmd/golden
# ./scripts/make-build-${OSTYPE}.sh
# ./golden --debug

That's all.
6 changes: 3 additions & 3 deletions scripts/make-build-darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ echo "Arch: ${GOARCH}"
# Step 1. Get Go modules
#
echo "==> Step 1. Get Go modules..."
go get -v ./...
go get -v ../...

# Step 2. Generate assets
#
Expand All @@ -23,9 +23,9 @@ go generate
# Step 3. Run unittest
#
echo "==> Step 3. Run unittest..."
go test ./...
go test ../...

# Step 4. Compile executable
#
echo "==> Step 4. Compile executable..."
go build -o golden-${GOOS}-${GOARCH} ./cmd/golden
go build -o ../golden-${GOOS}-${GOARCH} ../cmd/golden
12 changes: 8 additions & 4 deletions scripts/make-build-linux.sh → scripts/make-build-linux-gnu.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
#!/bin/bash

SCRIPT_DIR="$(readlink -f $(dirname "$0"))"
SRC_DIR="$(dirname "${SCRIPT_DIR}")"

echo "=== Golden Point Compile Script ==="

# Step 0. Prepare environemnt
export GOOS="linux"
export GOARCH="amd64"
export CGO_ENABLED="1"
#
echo "OS: ${GOOS}"
echo " Src: ${SRC_DIR}"
echo " OS: ${GOOS}"
echo "Arch: ${GOARCH}"

# Step 1. Get Go modules
#
echo "==> Step 1. Get Go modules..."
go get -v ./...
go get -v ${SRC_DIR}/...

# Step 2. Generate assets
#
Expand All @@ -23,9 +27,9 @@ go generate
# Step 3. Run unittest
#
echo "==> Step 3. Run unittest..."
go test ./...
go test ${SRC_DIR}/...

# Step 4. Compile executable
#
echo "==> Step 4. Compile executable..."
go build -o golden-${GOOS}-${GOARCH} ./cmd/golden
go build -o ${SRC_DIR}/golden-${GOOS}-${GOARCH} ${SRC_DIR}/cmd/golden
6 changes: 6 additions & 0 deletions scripts/make-report-cyclo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

go install github.com/fzipp/gocyclo/cmd/gocyclo@latest

~/go/bin/gocyclo ..

3 changes: 3 additions & 0 deletions scripts/make-report-fmt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

go fmt ../...
6 changes: 6 additions & 0 deletions scripts/make-report-ineffassign.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

go install github.com/gordonklaus/ineffassign@latest

~/go/bin/ineffassign ../...

3 changes: 3 additions & 0 deletions scripts/make-report-vet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

go vet ../...

0 comments on commit ca5052e

Please sign in to comment.