Skip to content

Commit

Permalink
Merge pull request #58 from Clever/go1.21-update
Browse files Browse the repository at this point in the history
upgrade to go 1.21
  • Loading branch information
ChrisScotMartin authored Jan 8, 2024
2 parents aa0125e + 69753d9 commit 53a6ec9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ executors:
common-executor:
working_directory: ~/go/src/github.com/Clever/stealth
docker:
- image: cimg/go:1.16
- image: cimg/go:1.21
environment:
GOPRIVATE: github.com/Clever/*
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
Expand Down
16 changes: 11 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
module github.com/Clever/stealth

go 1.16
go 1.21

require (
github.com/Clever/unicreds v1.7.1
github.com/alecthomas/kingpin v2.2.6+incompatible
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/apex/log v1.9.0
github.com/aws/aws-sdk-go v1.34.24
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/olekukonko/tablewriter v0.0.5-0.20200416053754-163badb3bac6 // indirect
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.6.1
)

require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/jmespath/go-jmespath v0.3.0 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/olekukonko/tablewriter v0.0.5-0.20200416053754-163badb3bac6 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/versent/unicreds v1.5.0 // indirect
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 // indirect
gopkg.in/yaml.v3 v3.0.0 // indirect
Expand Down
21 changes: 7 additions & 14 deletions golang.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This is the default Clever Golang Makefile.
# It is stored in the dev-handbook repo, github.com/Clever/dev-handbook
# Please do not alter this file directly.
GOLANG_MK_VERSION := 1.1.0
GOLANG_MK_VERSION := 1.2.1

SHELL := /bin/bash
SYSTEM := $(shell uname -a | cut -d" " -f1 | tr '[:upper:]' '[:lower:]')
Expand Down Expand Up @@ -47,6 +47,8 @@ golang-ensure-curl-installed:
# Golint is a tool for linting Golang code for common errors.
# We pin its version because an update could add a new lint check which would make
# previously passing tests start failing without changing our code.
# this package is deprecated and frozen
# Infra recomendation is to eventaully move to https://github.com/golangci/golangci-lint so don't fail on linting error for now
GOLINT := $(GOPATH)/bin/golint
$(GOLINT):
go install -mod=readonly golang.org/x/lint/golint@738671d3881b9731cc63024d5d88cf28db875626
Expand Down Expand Up @@ -74,14 +76,6 @@ endef
# golang-lint-deps-strict requires the golint tool for golang linting.
golang-lint-deps-strict: $(GOLINT) $(FGT)

# golang-lint-strict calls golint on all golang files in the pkg and fails if any lint
# errors are found.
# arg1: pkg path
define golang-lint-strict
@echo "LINTING $(1)..."
@PKG_PATH=$$(go list -f '{{.Dir}}' $(1)); find $${PKG_PATH}/*.go -type f | grep -v gen_ | xargs $(FGT) $(GOLINT)
endef

# golang-test-deps is here for consistency
golang-test-deps:

Expand Down Expand Up @@ -147,7 +141,7 @@ golang-test-all-strict-deps: golang-fmt-deps golang-lint-deps-strict golang-test
# arg1: pkg path
define golang-test-all-strict
$(call golang-fmt,$(1))
$(call golang-lint-strict,$(1))
$(call golang-lint,$(1))
$(call golang-vet,$(1))
$(call golang-test-strict,$(1))
endef
Expand All @@ -160,7 +154,7 @@ golang-test-all-strict-cover-deps: golang-fmt-deps golang-lint-deps-strict golan
# arg1: pkg path
define golang-test-all-strict-cover
$(call golang-fmt,$(1))
$(call golang-lint-strict,$(1))
$(call golang-lint,$(1))
$(call golang-vet,$(1))
$(call golang-test-strict-cover,$(1))
endef
Expand All @@ -179,11 +173,10 @@ fi;
endef

# golang-setup-coverage: set up the coverage file
define golang-setup-coverage:
golang-setup-coverage:
@echo "mode: atomic" > coverage.txt
endef

# golang-update-makefile downloads latest version of golang.mk
golang-update-makefile:
@wget https://raw.githubusercontent.com/Clever/dev-handbook/master/make/golang-v1.mk -O /tmp/golang.mk 2>/dev/null
@if ! grep -q $(GOLANG_MK_VERSION) /tmp/golang.mk; then cp /tmp/golang.mk golang.mk && echo "golang.mk updated"; else echo "golang.mk is up-to-date"; fi
@if ! grep -q $(GOLANG_MK_VERSION) /tmp/golang.mk; then cp /tmp/golang.mk golang.mk && echo "golang.mk updated"; else echo "golang.mk is up-to-date"; fi

0 comments on commit 53a6ec9

Please sign in to comment.