Skip to content
This repository has been archived by the owner on Oct 28, 2023. It is now read-only.

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Kcrong committed Oct 3, 2023
1 parent 9c4e508 commit 46b6ad6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 38 deletions.
9 changes: 0 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ run:
# Default: 1m
timeout: 3m

# Exit code when at least one issue was found.
# Default: 1
issues-exit-code: 2

# Include test files or not.
# Default: true
tests: true
Expand All @@ -27,11 +23,6 @@ run:
skip-dirs:
- pkg/models

# Enables skipping of directories:
# - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
# Default: true
skip-dirs-use-default: true

# If set we pass it to "go list -mod={option}". From "go help modules":
# If invoked with -mod=readonly, the go command is disallowed from the implicit
# automatic updating of go.mod described above. Instead, it fails when any changes
Expand Down
22 changes: 12 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@ format:
@#go install golang.org/x/tools/cmd/goimports@latest
@#goimports -local "github.com/hodlgap/captive-portal" -w .
@go install -v github.com/incu6us/goimports-reviser/v3@latest
goimports-reviser -rm-unused \
@goimports-reviser -rm-unused \
-company-prefixes 'github.com/hodlgap' \
-excludes 'db' \
-project-name 'github.com/hodlgap/captive-portal' \
-format \
./...
gofmt -s -w .
go mod tidy
@gofmt -s -w .
@go mod tidy

.PHONY: lint
lint:
golangci-lint run
@golangci-lint run -v ./...

.PHONY: test
test:
@go install github.com/rakyll/gotest@latest
gotest -race -cover -v ./...
@gotest -race -cover -v ./...

.PHONY: update
update:
@go get -u all
go mod tidy
@go mod tidy

.PHONY: generate
generate:
@go install go.uber.org/mock/mockgen@latest
go generate ./...
@go generate ./...

.PHONY: models
models:
Expand All @@ -42,12 +42,14 @@ models:

.PHONY: dump-db
dump-db:
# This dumps your local postgres to db/schema.sql
PGPASSWORD=example pg_dump --no-owner --schema-only --no-privileges --host=localhost --username=postgres --dbname=captive-portal > db/schema.sql
@# This dumps your local postgres to db/schema.sql
@PGPASSWORD=example pg_dump --no-owner --schema-only --no-privileges --host=localhost --username=postgres --dbname=captive-portal > db/schema.sql
echo "db/schema.sql"

.PHONY: restore-db
restore-db:
# This restores your local postgres to db/schema.sql
#PGPASSWORD=example psql --host=localhost --username=postgres --dbname=captive-portal -c "drop database if exists \"captive-portal\";"
PGPASSWORD=example psql -h localhost -U postgres -d captive-portal < db/schema.sql
@PGPASSWORD=example psql -h localhost -U postgres -d captive-portal < db/schema.sql
echo "Completed"

3 changes: 2 additions & 1 deletion pkg/handler/captiveportal/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"crypto/cipher"
"encoding/base64"
"fmt"
"github.com/hodlgap/captive-portal/pkg/auth"
"net/http"
"net/http/httptest"
"strings"
Expand All @@ -15,6 +14,8 @@ import (
echo "github.com/labstack/echo/v4"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"

"github.com/hodlgap/captive-portal/pkg/auth"
)

// nolint:unused
Expand Down
18 changes: 0 additions & 18 deletions pkg/handler/route.go

This file was deleted.

0 comments on commit 46b6ad6

Please sign in to comment.