Skip to content

[INFRANG-6876] Upgrade to go 1.24 #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.21
- image: cimg/go:1.24
environment:
GOPRIVATE: github.com/Clever/*
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ APP_NAME ?= stealth
EXECUTABLE = $(APP_NAME)
PKG = github.com/Clever/$(APP_NAME)
PKGS = $(shell go list ./... | grep -v /gen-go | grep -v /tools)
$(eval $(call golang-version-check,1.16))
$(eval $(call golang-version-check,1.24))

all: test build

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/Clever/stealth

go 1.22
go 1.24

toolchain go1.24.1

Expand Down
29 changes: 20 additions & 9 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.2.1
GOLANG_MK_VERSION := 1.3.1

SHELL := /bin/bash
SYSTEM := $(shell uname -a | cut -d" " -f1 | tr '[:upper:]' '[:lower:]')
Expand Down Expand Up @@ -48,7 +48,7 @@ golang-ensure-curl-installed:
# 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
# Infra recommendation is to eventually 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 @@ -159,17 +159,28 @@ $(call golang-vet,$(1))
$(call golang-test-strict-cover,$(1))
endef

# golang-build: builds a golang binary. ensures CGO build is done during CI. This is needed to make a binary that works with a Docker alpine image.
# golang-build: builds a golang binary
# arg1: pkg path
# arg2: executable name
define golang-build
@echo "BUILDING $(2)..."
@if [ -z "$$CI" ]; then \
go build -o bin/$(2) $(1); \
else \
echo "-> Building CGO binary"; \
CGO_ENABLED=0 go build -installsuffix cgo -o bin/$(2) $(1); \
fi;
@CGO_ENABLED=0 go build -o bin/$(2) $(1);
endef

# golang-debug-build: builds a golang binary with debugging capabilities
# arg1: pkg path
# arg2: executable name
define golang-debug-build
@echo "BUILDING $(2) FOR DEBUG..."
@CGO_ENABLED=0 go build -gcflags="all=-N -l" -o bin/$(2) $(1);
endef

# golang-cgo-build: builds a golang binary with CGO
# arg1: pkg path
# arg2: executable name
define golang-cgo-build
@echo "BUILDING $(2) WITH CGO ..."
@CGO_ENABLED=1 go build -installsuffix cgo -o bin/$(2) $(1);
endef

# golang-setup-coverage: set up the coverage file
Expand Down