Skip to content

Commit

Permalink
go: bumped to v1.20 & upgraded all deps
Browse files Browse the repository at this point in the history
  • Loading branch information
mvisonneau committed Apr 26, 2023
1 parent e84fec5 commit b564393
Show file tree
Hide file tree
Showing 11 changed files with 109 additions and 197 deletions.
2 changes: 1 addition & 1 deletion .github/prerelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ trap cleanup EXIT
# Build the binaries using a prerelease tag
git tag -d edge
git tag -f ${PRERELEASE_TAG}
goreleaser release \
go run github.com/goreleaser/[email protected] release \
--rm-dist \
--skip-validate \
-f .goreleaser.pre.yml
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
release:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

env:
DOCKER_CLI_EXPERIMENTAL: 'enabled'
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: 1.20

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v3
Expand All @@ -62,7 +62,7 @@ jobs:
- name: Install goreleaser
uses: goreleaser/goreleaser-action@v2
with:
version: v1.12.3
version: v1.15.2
install-only: true

- name: Run goreleaser
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: 1.20

- name: Lint
if: ${{ matrix.os == 'ubuntu-20.04' }}
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: make lint

- name: Test
run: make coverage

- name: Publish coverage to coveralls.io
uses: shogo82148/actions-goveralls@v1
if: ${{ matrix.os == 'ubuntu-20.04' }}
if: ${{ matrix.os == 'ubuntu-22.04' }}
with:
path-to-profile: coverage.out

Expand Down
20 changes: 20 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

linters:
enable:
- gci
- gofmt
- goimports
- gosec
- loggercheck
- misspell
- nilerr
- nilnil
- noctx
- unparam

linters-settings:
gci:
sections:
- standard
- default
- prefix(github.com/mvisonneau)
32 changes: 0 additions & 32 deletions .revive.toml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [0ver](https://0ver.org) (more or less).

## [Unreleased]

### Changed

- Golang updated to `1.20`
- Bumped all dependencies
-
## [v0.0.8] - 2021-11-15

### Added
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# BUILD CONTAINER
##

FROM alpine:3.16 as certs
FROM alpine:3.17 as certs

RUN \
apk add --no-cache ca-certificates
Expand All @@ -11,7 +11,7 @@ RUN \
# RELEASE CONTAINER
##

FROM busybox:1.35-glibc
FROM busybox:1.36-glibc

WORKDIR /

Expand Down
51 changes: 13 additions & 38 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
NAME := vac
FILES := $(shell git ls-files */*.go)
COVERAGE_FILE := coverage.out
REPOSITORY := mvisonneau/$(NAME)
.DEFAULT_GOAL := help

.PHONY: setup
setup: ## Install required libraries/tools for build tasks
@command -v gofumpt 2>&1 >/dev/null || go install mvdan.cc/[email protected]
@command -v golangci-lint 2>&1 >/dev/null || go install github.com/golangci/golangci-lint/cmd/[email protected]

.PHONY: fmt
fmt: setup ## Format source code
gofumpt -w $(FILES)
fmt: ## Format source code
go run mvdan.cc/[email protected] -w $(shell git ls-files **/*.go)
go run github.com/daixiang0/[email protected] write -s standard -s default -s "prefix(github.com/mvisonneau)" .

.PHONY: lint
lint: setup ## Run all lint related tests upon the codebase
golangci-lint run -v --fast
lint: ## Run all lint related tests upon the codebase
go run github.com/golangci/golangci-lint/cmd/[email protected] run -v --fast

.PHONY: test
test: ## Run the tests against the codebase
go test -v -count=1 -race ./...
@rm -rf $(COVERAGE_FILE)
go test -v -count=1 -race ./... -coverprofile=$(COVERAGE_FILE)
@go tool cover -func $(COVERAGE_FILE) | awk '/^total/ {print "coverage: " $$3}'

.PHONY: coverage
coverage: ## Prints coverage report
go tool cover -func $(COVERAGE_FILE)

.PHONY: install
install: ## Build and install locally the binary (dev purpose)
Expand All @@ -28,11 +30,6 @@ install: ## Build and install locally the binary (dev purpose)
build: ## Build the binaries using local GOOS
go build ./cmd/$(NAME)

.PHONY: release
release: ## Build & release the binaries (stable)
git tag -d edge
goreleaser release --rm-dist

.PHONY: prerelease
prerelease: setup ## Build & prerelease the binaries (edge)
@\
Expand All @@ -45,28 +42,6 @@ prerelease: setup ## Build & prerelease the binaries (edge)
clean: ## Remove binary if it exists
rm -f $(NAME)

.PHONY: coverage
coverage: ## Generates coverage report
rm -rf *.out
go test -count=1 -race -v ./... -coverpkg=./... -coverprofile=coverage.out

.PHONY: coverage-html
coverage-html: ## Generates coverage report and displays it in the browser
go tool cover -html=coverage.out

.PHONY: dev-env
dev-env: ## Build a local development environment using Docker
@docker run -it --rm \
-v $(shell pwd):/go/src/github.com/mvisonneau/$(NAME) \
-w /go/src/github.com/mvisonneau/$(NAME) \
golang:1.19 \
/bin/bash -c 'make setup; make install; bash'

.PHONY: is-git-dirty
is-git-dirty: ## Tests if git is in a dirty state
@git status --porcelain
@test $(shell git status --porcelain | grep -c .) -eq 0

.PHONY: all
all: lint test build coverage ## Test, builds and ship package for all supported platforms

Expand Down
52 changes: 17 additions & 35 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,75 +1,57 @@
module github.com/mvisonneau/vac

go 1.19
go 1.20

require (
github.com/hashicorp/vault/api v1.8.2
github.com/hashicorp/vault/sdk v0.6.1
github.com/hashicorp/vault/api v1.9.0
github.com/hashicorp/vault/sdk v0.8.1
github.com/ktr0731/go-fuzzyfinder v0.5.1
github.com/mitchellh/go-homedir v1.1.0
github.com/mvisonneau/go-helpers v0.0.1
github.com/olekukonko/tablewriter v0.0.5
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.0
github.com/stretchr/testify v1.8.1
github.com/urfave/cli/v2 v2.23.5
github.com/urfave/cli/v2 v2.24.4
github.com/xeonx/timeago v1.0.0-rc5
)

require (
github.com/armon/go-metrics v0.4.1 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/cenkalti/backoff/v3 v3.2.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/fatih/color v1.14.1 // indirect
github.com/gdamore/encoding v1.0.0 // indirect
github.com/gdamore/tcell/v2 v2.5.3 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/gdamore/tcell/v2 v2.6.0 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v1.3.1 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-hclog v1.4.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.4.6 // indirect
github.com/hashicorp/go-retryablehttp v0.7.1 // indirect
github.com/hashicorp/go-retryablehttp v0.7.2 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/go-secure-stdlib/mlock v0.1.2 // indirect
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7 // indirect
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/nsf/termbox-go v1.1.1 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.4.2 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
go.uber.org/atomic v1.10.0 // indirect
golang.org/x/crypto v0.2.0 // indirect
golang.org/x/net v0.2.0 // indirect
golang.org/x/sys v0.2.0 // indirect
golang.org/x/term v0.2.0 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/time v0.2.0 // indirect
google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1 // indirect
google.golang.org/grpc v1.50.1 // indirect
google.golang.org/protobuf v1.28.1 // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/time v0.3.0 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Expand Down
Loading

0 comments on commit b564393

Please sign in to comment.