Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
--health-timeout 5s
--health-retries 5
steps:
- name: Set up Go 1.16
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
id: go

- name: Check out code into the Go module directory
Expand All @@ -41,10 +41,14 @@ jobs:
- name: Get dependencies
run: go mod download

- name: Lint
run: make lint
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
skip-pkg-cache: true
skip-build-cache: true

- name: Build
- name: Run tests
env:
HAMMER_TEST_DATABASE_URL: "postgres://test:test@localhost:5432/hammer_test?sslmode=disable"
run: make db-test-migrate && make test
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
linters:
enable:
- gosec
- rowserrcheck
- sqlclosecheck
- ifshort
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ build-protobuf:
lint:
if [ ! -f ./bin/golangci-lint ] ; \
then \
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.38.0; \
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.42.1; \
fi;
./bin/golangci-lint run -E gosec
./bin/golangci-lint run

test:
go test -covermode=count -coverprofile=count.out -v ./...
Expand Down
5 changes: 2 additions & 3 deletions cmd/hammer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,7 @@ func main() {
},
}

err := app.Run(os.Args)
if err != nil {
zap.L().Fatal("app", zap.Error(err))
if err := app.Run(os.Args); err != nil {
zap.L().Error("app", zap.Error(err))
}
}
54 changes: 39 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,27 +1,51 @@
module github.com/allisson/hammer

go 1.16
go 1.17

require (
github.com/DATA-DOG/go-txdb v0.1.3
github.com/DATA-DOG/go-txdb v0.1.4
github.com/allisson/go-env v0.3.0
github.com/go-ozzo/ozzo-validation/v4 v4.3.0
github.com/golang-migrate/migrate/v4 v4.14.1
github.com/golang/protobuf v1.5.1
github.com/grpc-ecosystem/go-grpc-middleware v1.2.2
github.com/golang-migrate/migrate/v4 v4.15.0
github.com/golang/protobuf v1.5.2
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/huandu/go-sqlbuilder v1.12.0
github.com/jmoiron/sqlx v1.3.1
github.com/joho/godotenv v1.3.0
github.com/lib/pq v1.10.0
github.com/huandu/go-sqlbuilder v1.13.0
github.com/jmoiron/sqlx v1.3.4
github.com/joho/godotenv v1.4.0
github.com/lib/pq v1.10.3
github.com/oklog/ulid/v2 v2.0.2
github.com/prometheus/client_golang v1.10.0
github.com/prometheus/client_golang v1.11.0
github.com/stretchr/testify v1.7.0
github.com/urfave/cli/v2 v2.3.0
go.uber.org/zap v1.16.0
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4
google.golang.org/genproto v0.0.0-20210317182105-75c7a8546eb9
google.golang.org/grpc v1.36.0
google.golang.org/protobuf v1.26.0
go.uber.org/zap v1.19.1
golang.org/x/net v0.0.0-20210929193557-e81a3d93ecf6
google.golang.org/genproto v0.0.0-20211001223012-bfb93cce50d9
google.golang.org/grpc v1.41.0
google.golang.org/protobuf v1.27.1
)

require (
github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.1.0 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/stretchr/objx v0.2.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
golang.org/x/text v0.3.6 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
889 changes: 373 additions & 516 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mocks/DeliveryAttemptRepository.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/DeliveryAttemptService.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/DeliveryRepository.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/DeliveryService.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/HammerClient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/HammerServer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/MessageRepository.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/MessageService.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/MigrationRepository.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/MigrationService.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/SubscriptionRepository.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/SubscriptionService.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/TopicRepository.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/TopicService.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/WorkerService.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.