diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index fc55977..551f9d0 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -29,8 +29,8 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: "~1.22" + go-version: 1.24.2 - name: golangci-lint - uses: golangci/golangci-lint-action@v6.2.0 + uses: golangci/golangci-lint-action@v7.0.0 with: - version: v1.58.0 + version: v2.1.2 diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 692e728..839a122 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: robinraju/release-downloader@v1.11 + - uses: robinraju/release-downloader@v1.12 with: repository: "coder/code-marketplace" tag: ${{ github.event.inputs.version || github.ref_name }} diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 0000000..387c5e4 --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,4 @@ +version: "2" +linters: + disable: + - errcheck diff --git a/api/api_test.go b/api/api_test.go index ab7ff40..86bd1ab 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -305,7 +305,8 @@ func TestAPI(t *testing.T) { var resp *http.Response var err error - if method == http.MethodPost { + switch method { + case http.MethodPost: var body []byte if str, ok := c.Request.(string); ok { body = []byte(str) @@ -314,9 +315,9 @@ func TestAPI(t *testing.T) { require.NoError(t, err) } resp, err = client.Post(url, "application/json", bytes.NewReader(body)) - } else if method == http.MethodGet { + case http.MethodGet: resp, err = client.Get(url) - } else { + default: t.Fatal(method + " is not handled in the test yet, please add it now") } require.NoError(t, err) diff --git a/flake.lock b/flake.lock index d6c2c5a..9f3817b 100644 --- a/flake.lock +++ b/flake.lock @@ -1,12 +1,15 @@ { "nodes": { "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -17,12 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1661353537, - "narHash": "sha256-1E2IGPajOsrkR49mM5h55OtYnU0dGyre6gl60NXKITE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "0e304ff0d9db453a4b230e9386418fd974d5804a", - "type": "github" + "lastModified": 1744932701, + "narHash": "sha256-fusHbZCyv126cyArUwwKrLdCkgVAIaa/fQJYFlCEqiU=", + "path": "/nix/store/isfbldda5j8j6x3nbv1zim0c0dpf90v8-source", + "rev": "b024ced1aac25639f8ca8fdfc2f8c4fbd66c48ef", + "type": "path" }, "original": { "id": "nixpkgs", @@ -34,6 +36,21 @@ "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index fdc309b..be8e3d2 100644 --- a/flake.nix +++ b/flake.nix @@ -10,7 +10,7 @@ in { devShells.default = pkgs.mkShell { buildInputs = with pkgs; [ - go_1_19 + go_1_24 golangci-lint gotestsum kubernetes-helm