Skip to content

log delivery pending changes #18416

log delivery pending changes

log delivery pending changes #18416

Workflow file for this run

# Copyright IBM Corp. 2014, 2026
# "SPDX-License-Identifier: MPL-2.0"
name: Modern Go Check
on:
push:
branches:
- main
- "release/**"
pull_request:
paths:
- "**/*.go"
- .github/workflows/modern_go.yml
## NOTE: !!!
## When changing these workflows, ensure that the following is updated:
## - Documentation: docs/continuous-integration.md
## - Documentation: docs/makefile-cheat-sheet.md
## - Makefile: ./GNUmakefile
permissions:
contents: read # required for checkout
jobs:
modern:
name: Check for modern Go code
runs-on: custom-ubuntu-22.04-large
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
# See also: https://github.com/actions/setup-go/issues/54
- name: go env
run: |
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
echo "CACHE_DATE=$(date +%Y-%m-%d)" >> $GITHUB_ENV
- uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
continue-on-error: true
timeout-minutes: 2
with:
path: ${{ env.GOCACHE }}
key: ${{ runner.os }}-go-build-${{ env.CACHE_DATE }}
restore-keys: |
${{ runner.os }}-go-build-
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
continue-on-error: true
timeout-minutes: 2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
# Don't use make target as it downloads a Go version.
# - run: make TEST=./... modern-check
- run: go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@v0.21.0 -test ./...