traefik / plugindemo

This repository includes an example plugin, for you to use as a reference for developing your own plugins
https://plugins.traefik.io/plugins/628c9ee2108ecc83915d7764/demo-plugin
Apache License 2.0
140 stars 45 forks source link

Update Go version #24

Open FlowingSPDG opened 2 months ago

FlowingSPDG commented 2 months ago

Hi, I tried to make a plugin by myself and noticed Go itself and several tools version are old so I updated.

Updated tools

Updated tool settings

Other

Maybe we can use package plugindemo instead of package plugindemo_test for demo_test.go since golangci-lint detects depguard because it imports not-test package?

FlowingSPDG commented 2 months ago

@ldez Hey, thanks for the review!

I applied your suggestion :) thank you!

ldez commented 2 months ago

All the following section:

```yml steps: # https://github.com/marketplace/actions/setup-go-environment - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}(${{ matrix.arch }}) uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} architecture: ${{ matrix.arch }} # https://github.com/marketplace/actions/checkout - name: Checkout code uses: actions/checkout@v2 # https://github.com/marketplace/actions/cache - name: Cache Go modules uses: actions/cache@v3 with: # In order: # * Module download cache # * Build cache (Linux) # * Build cache (Mac) # * Build cache (Windows) path: | ~/go/pkg/mod ~/.cache/go-build ~/Library/Caches/go-build %LocalAppData%\go-build key: ${{ runner.os }}-${{ matrix.arch }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-${{ matrix.arch }}-${{ matrix.go-version }}-go- ```

should be replaced by:

steps:
  - uses: actions/checkout@v4
  - uses: actions/setup-go@v5
    with:
      go-version: ${{ matrix.go-version }}
      architecture: ${{ matrix.arch }}
FlowingSPDG commented 1 month ago

@ldez Hi, sorry for late response since I was busy!

I updated the actions but got Bad CPU type in executable error on some job. I'll dig into it and apply change if needed :)

ldez commented 1 month ago

Sorry you must remove:

architecture: ${{ matrix.arch }}

and the element related to the matrix.

Github action supports only amd64.

FlowingSPDG commented 1 month ago

@ldez thank you for code suggestion, applied!