-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
udhos
committed
May 21, 2023
1 parent
dfa9a32
commit 66bdcf1
Showing
14 changed files
with
190 additions
and
184 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
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 |
---|---|---|
@@ -1,92 +1,23 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
step=0 | ||
go install golang.org/x/vuln/cmd/govulncheck@latest | ||
|
||
msg() { | ||
step=$((step+1)) | ||
echo >&2 $step. $* | ||
} | ||
gofmt -s -w . | ||
|
||
get() { | ||
i=$1 | ||
msg fetching $i | ||
go get $i | ||
msg fetching $i - done | ||
} | ||
revive ./... | ||
|
||
get github.com/icza/gowut/gwu | ||
get github.com/udhos/difflib | ||
get github.com/udhos/lockfile | ||
get github.com/udhos/equalfile | ||
get gopkg.in/yaml.v2 | ||
get golang.org/x/crypto/ssh | ||
get github.com/aws/aws-sdk-go | ||
#get honnef.co/go/simple/cmd/gosimple | ||
#get honnef.co/go/tools/cmd/staticcheck | ||
#gocyclo -over 15 . | ||
|
||
src=`find . -type f | egrep '\.go$'` | ||
go mod tidy | ||
|
||
msg fmt | ||
gofmt -s -w $src | ||
msg fix | ||
go tool fix $src | ||
msg vet | ||
go tool vet . | ||
govulncheck ./... | ||
|
||
msg install | ||
pkg=github.com/udhos/jazigo | ||
go install $pkg/jazigo | ||
go env -w CGO_ENABLED=1 | ||
|
||
# go get honnef.co/go/simple/cmd/gosimple | ||
s=$GOPATH/bin/gosimple | ||
simple() { | ||
msg simple - this is slow, please standby | ||
# gosimple cant handle source files from multiple packages | ||
$s jazigo/*.go | ||
$s conf/*.go | ||
$s dev/*.go | ||
$s store/*.go | ||
$s temp/*.go | ||
} | ||
[ -x "$s" ] && simple | ||
go test -race ./... | ||
|
||
# go get github.com/golang/lint/golint | ||
l=$GOPATH/bin/golint | ||
lint() { | ||
msg lint | ||
# golint cant handle source files from multiple packages | ||
$l jazigo/*.go | ||
$l conf/*.go | ||
$l dev/*.go | ||
$l store/*.go | ||
$l temp/*.go | ||
} | ||
[ -x "$l" ] && lint | ||
go env -w CGO_ENABLED=0 | ||
|
||
# go get honnef.co/go/tools/cmd/staticcheck | ||
sc=$GOPATH/bin/staticcheck | ||
static() { | ||
msg staticcheck - this is slow, please standby | ||
# staticcheck cant handle source files from multiple packages | ||
$sc jazigo/*.go | ||
$sc conf/*.go | ||
$sc dev/*.go | ||
$sc store/*.go | ||
$sc temp/*.go | ||
} | ||
[ -x "$sc" ] && static | ||
go install ./... | ||
|
||
msg test dev - this may take a while, please stand by | ||
go test github.com/udhos/jazigo/dev | ||
|
||
msg test store | ||
if [ -z "$JAZIGO_S3_REGION" ]; then | ||
echo >&2 JAZIGO_S3_REGION undefined -- for S3 testing, set JAZIGO_S3_REGION=region | ||
fi | ||
if [ -z "$JAZIGO_S3_FOLDER" ]; then | ||
echo >&2 JAZIGO_S3_FOLDER undefined -- for S3 testing, set JAZIGO_S3_FOLDER=bucket/folder | ||
fi | ||
go test github.com/udhos/jazigo/store | ||
|
||
msg test jazigo | ||
go test github.com/udhos/jazigo/jazigo | ||
go env -u CGO_ENABLED |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Package dev provides access to multiple devices. | ||
package dev | ||
|
||
import ( | ||
|
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
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
Oops, something went wrong.