Skip to content

Commit

Permalink
build: go v1.21.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmidyson committed Oct 16, 2023
1 parent 7d58412 commit 4e0a7f1
Show file tree
Hide file tree
Showing 8 changed files with 169 additions and 24 deletions.
8 changes: 7 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ linters:
- errcheck
- errchkjson
- errname
- gocheckcompilerdirectives
- gochecknoinits
- gci
- ginkgolinter
- goconst
- gocritic
- gocyclo
Expand All @@ -25,18 +27,23 @@ linters:
- govet
- ineffassign
- lll
- loggercheck
- mirror
- misspell
- nolintlint
- prealloc
- reassign
- staticcheck
- stylecheck
- tenv
- testableexamples
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- whitespace

linters-settings:
Expand Down Expand Up @@ -66,7 +73,6 @@ linters-settings:
- performance
- style
gofumpt:
lang-version: "1.17"
extra-rules: true
lll:
line-length: 120
Expand Down
7 changes: 3 additions & 4 deletions devbox.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"packages": [
"[email protected]",
"bash@latest",
"coreutils@latest",
"crane@latest",
Expand All @@ -10,14 +9,14 @@
"gnused@latest",
"gnugrep@latest",
"gnumake@latest",
"go@latest",
"gojq@latest",
"golangci-lint@latest",
"path:./hack/flakes/golangci-lint",
"golines@latest",
"goreleaser@latest",
"gotestsum@latest",
"kubernetes-helm@latest",
"pre-commit@latest",
"shfmt@latest",
"upx@latest"
"shfmt@latest"
]
}
36 changes: 19 additions & 17 deletions devbox.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,32 @@
"source": "devbox-search",
"version": "4.9"
},
"[email protected]": {
"last_modified": "2023-06-30T04:44:22Z",
"resolved": "github:NixOS/nixpkgs/3c614fbc76fc152f3e1bc4b2263da6d90adf80fb#go",
"source": "devbox-search",
"version": "1.20.5"
"go@latest": {
"last_modified": "2023-09-27T18:02:17Z",
"resolved": "github:NixOS/nixpkgs/517501bcf14ae6ec47efd6a17dda0ca8e6d866f9#go_1_21",
"source": "devbox-search",
"version": "1.21.1",
"systems": {
"aarch64-darwin": {
"store_path": "/nix/store/s1xk6hrfn0kw8ycvqbx4vv4gr00k6qpl-go-1.21.1"
},
"aarch64-linux": {
"store_path": "/nix/store/id3ygqxp1hvbh7dyjlwngx53fvcpqg84-go-1.21.1"
},
"x86_64-darwin": {
"store_path": "/nix/store/yn0g820ayb963s0i4nnw9pf72l49kkg0-go-1.21.1"
},
"x86_64-linux": {
"store_path": "/nix/store/pvvv2lmx9m8b2n0447mljrl5xmla8r3h-go-1.21.1"
}
}
},
"gojq@latest": {
"last_modified": "2023-06-29T16:20:38Z",
"resolved": "github:NixOS/nixpkgs/3c614fbc76fc152f3e1bc4b2263da6d90adf80fb#gojq",
"source": "devbox-search",
"version": "0.12.13"
},
"golangci-lint@latest": {
"last_modified": "2023-06-29T16:20:38Z",
"resolved": "github:NixOS/nixpkgs/3c614fbc76fc152f3e1bc4b2263da6d90adf80fb#golangci-lint",
"source": "devbox-search",
"version": "1.53.3"
},
"golines@latest": {
"last_modified": "2023-05-07T06:59:10Z",
"resolved": "github:NixOS/nixpkgs/eb751d65225ec53de9cf3d88acbf08d275882389#golines",
Expand Down Expand Up @@ -108,12 +116,6 @@
"resolved": "github:NixOS/nixpkgs/3c614fbc76fc152f3e1bc4b2263da6d90adf80fb#shfmt",
"source": "devbox-search",
"version": "3.7.0"
},
"upx@latest": {
"last_modified": "2023-05-07T06:59:10Z",
"resolved": "github:NixOS/nixpkgs/eb751d65225ec53de9cf3d88acbf08d275882389#upx",
"source": "devbox-search",
"version": "4.0.2"
}
}
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

module github.com/mesosphere/mindthegap

go 1.20
go 1.21

require (
github.com/aws/aws-sdk-go-v2 v1.21.2
Expand Down
30 changes: 30 additions & 0 deletions go.sum

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions hack/flakes/golangci-lint/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions hack/flakes/golangci-lint/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright 2023 D2iQ, Inc. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

{
description = "Fast linters Runner for Go";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils/v1.0.0";
};

outputs =
{ self
, nixpkgs
, utils
,
}:
let
appReleaseVersion = "1.54.2";
appReleaseBinaries = {
"x86_64-linux" = {
fileName = "golangci-lint-${appReleaseVersion}-linux-amd64.tar.gz";
sha256 = "17c9ca05253efe833d47f38caf670aad2202b5e6515879a99873fabd4c7452b3";
};
"x86_64-darwin" = {
fileName = "golangci-lint-${appReleaseVersion}-darwin-amd64.tar.gz";
sha256 = "925c4097eae9e035b0b052a66d0a149f861e2ab611a4e677c7ffd2d4e05b9b89";
};
"aarch64-darwin" = {
fileName = "golangci-lint-${appReleaseVersion}-darwin-arm64.tar.gz";
sha256 = "7b33fb1be2f26b7e3d1f3c10ce9b2b5ce6d13bb1d8468a4b2ba794f05b4445e1";
};
};
supportedSystems = builtins.attrNames appReleaseBinaries;
in
utils.lib.eachSystem supportedSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
appReleaseBinary = appReleaseBinaries.${system};
in
rec {
packages.golangci-lint = pkgs.stdenv.mkDerivation {
pname = "golangci-lint";
version = appReleaseVersion;

src = pkgs.fetchurl {
url = "https://github.com/golangci/golangci-lint/releases/download/v${appReleaseVersion}/${appReleaseBinary.fileName}";
sha256 = appReleaseBinary.sha256;
};

sourceRoot = ".";

installPhase = ''
install -m755 -D */golangci-lint $out/bin/golangci-lint
'';
};
packages.default = packages.golangci-lint;

apps.golangci-lint = utils.lib.mkApp {
drv = packages.golangci-lint;
};
apps.default = apps.golangci-lint;
});
}
2 changes: 1 addition & 1 deletion images/manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ func TestManifestListForImage_RemoteImage(t *testing.T) {

mux := http.NewServeMux()
mux.Handle("/v2/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(200)
w.WriteHeader(http.StatusOK)
}))
mux.Handle(
"/v2/mesosphere/kube-apiserver/manifests/v1.24.4_fips.0",
Expand Down

0 comments on commit 4e0a7f1

Please sign in to comment.