Skip to content

Commit

Permalink
Check go.mod
Browse files Browse the repository at this point in the history
Signed-off-by: Daichi Sakaue <[email protected]>
  • Loading branch information
yokaze committed Apr 5, 2024
1 parent d831339 commit 34360f3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
key: cache-files-${{ env.cache-version }}-go-${{ hashFiles('go.mod') }}-${{ hashFiles('Makefile') }}
- name: Setup tools
run: make setup
- name: Run code check
run: make check-generate
- name: Run lint
run: make lint
- name: Run environment
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ build: ## Build cilium-policy-viewer
mkdir -p $(BIN_DIR)
go build -o $(BIN_DIR)/cilium-policy main.go

.PHONY: check-generate
check-generate:
go mod tidy
git diff --exit-code --name-only

.PHONY: lint
lint: ## Run lint tools
go vet ./...
Expand Down
4 changes: 2 additions & 2 deletions e2e/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
func testJson(g Gomega, target []byte, expected string) {
var t, e interface{}
err := json.Unmarshal(target, &t)
g.Expect(err).NotTo(HaveOccurred(), "actual: %s", target, expected)
g.Expect(err).NotTo(HaveOccurred(), "actual: %s", target)

err = json.Unmarshal([]byte(expected), &e)
g.Expect(err).NotTo(HaveOccurred(), "expected: %s", target, expected)
g.Expect(err).NotTo(HaveOccurred(), "expected: %s", expected)

if !reflect.DeepEqual(t, e) {
err := fmt.Errorf("compare failed. actual: %s, expected: %s", target, expected)
Expand Down

0 comments on commit 34360f3

Please sign in to comment.