diff --git a/.github/workflows/api.image+upload.yaml b/.github/workflows/api.image+upload.yaml index a7093b6f2..2e6104292 100644 --- a/.github/workflows/api.image+upload.yaml +++ b/.github/workflows/api.image+upload.yaml @@ -60,22 +60,6 @@ jobs: cache-dependency-path: | ./api/go.sum - - name: Run lint - uses: golangci/golangci-lint-action@v3 - with: - version: v1.54 - working-directory: api - skip-pkg-cache: true - skip-build-cache: true - args: --timeout=10m - - - name: Run Vet - run: | - cd ./api - go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest - go vet - go vet -vettool=$(which shadow) - - name: Docker build orakl-api run: SERVICE_NAME=orakl-api docker compose -f docker-compose.build.yaml build diff --git a/.github/workflows/api.test.yaml b/.github/workflows/api.test.yaml index 8a0c1c58c..aeeaebdf2 100644 --- a/.github/workflows/api.test.yaml +++ b/.github/workflows/api.test.yaml @@ -46,6 +46,20 @@ jobs: check-latest: true cache-dependency-path: | ./api/go.sum + - name: Run lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.54 + working-directory: api + skip-pkg-cache: true + skip-build-cache: true + args: --timeout=10m + - name: Run Vet + run: | + cd ./api + go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest + go vet + go vet -vettool=$(which shadow) - name: Install golang-migrate run: | curl -L https://github.com/golang-migrate/migrate/releases/download/v4.17.0/migrate.linux-amd64.tar.gz | tar xvz diff --git a/.github/workflows/delegator.image+upload.yaml b/.github/workflows/delegator.image+upload.yaml index 51efab810..3c56c3200 100644 --- a/.github/workflows/delegator.image+upload.yaml +++ b/.github/workflows/delegator.image+upload.yaml @@ -58,22 +58,6 @@ jobs: cache-dependency-path: | ./delegator/go.sum - - name: Run lint - uses: golangci/golangci-lint-action@v3 - with: - version: v1.54 - working-directory: delegator - skip-pkg-cache: true - skip-build-cache: true - args: --timeout=10m --skip-dirs=tests - - - name: Run vet - run: | - cd ./delegator - go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest - go vet - go vet -vettool=$(which shadow) - - name: Docker build orakl-delegator run: SERVICE_NAME=orakl-delegator docker compose -f docker-compose.build.yaml build diff --git a/.github/workflows/delegator.test+build.yaml b/.github/workflows/delegator.test+build.yaml index 5a3419f86..ad26b7e92 100644 --- a/.github/workflows/delegator.test+build.yaml +++ b/.github/workflows/delegator.test+build.yaml @@ -33,6 +33,20 @@ jobs: check-latest: true cache-dependency-path: | ./delegator/go.sum + - name: Run lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.54 + working-directory: delegator + skip-pkg-cache: true + skip-build-cache: true + args: --timeout=10m --skip-dirs=tests + - name: Run vet + run: | + cd ./delegator + go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest + go vet + go vet -vettool=$(which shadow) - name: Install golang-migrate run: | curl -L https://github.com/golang-migrate/migrate/releases/download/v4.17.0/migrate.linux-amd64.tar.gz | tar xvz diff --git a/api/blocks/controller.go b/api/blocks/controller.go index 5a537e615..5bcd7ed3d 100644 --- a/api/blocks/controller.go +++ b/api/blocks/controller.go @@ -20,7 +20,7 @@ var validate *validator.Validate func init() { validate = validator.New() - validate.RegisterValidation("isZeroOrPositive", func(fl validator.FieldLevel) bool { + _ = validate.RegisterValidation("isZeroOrPositive", func(fl validator.FieldLevel) bool { return fl.Field().Int() >= 0 }) }