diff --git a/.go-version b/.go-version index b45fe31064..dd43a143f0 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.25.5 +1.26.1 diff --git a/.golangci.yaml b/.golangci.yaml index f2a7ab3f0a..f8a77daf16 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -125,6 +125,20 @@ linters: disabled: true - name: unused-receiver disabled: true + - name: package-directory-mismatch + disabled: true + - name: enforce-switch-style + disabled: true + - name: use-waitgroup-go + disabled: true + - name: use-slices-sort + disabled: true + - name: identical-switch-branches + disabled: true + - name: package-naming + disabled: true + - name: epoch-naming + disabled: true staticcheck: checks: - "all" diff --git a/bin/.go-1.25.5.pkg b/bin/.go-1.26.1.pkg similarity index 100% rename from bin/.go-1.25.5.pkg rename to bin/.go-1.26.1.pkg diff --git a/bin/.golangci-lint-2.4.0.pkg b/bin/.golangci-lint-2.11.3.pkg similarity index 100% rename from bin/.golangci-lint-2.4.0.pkg rename to bin/.golangci-lint-2.11.3.pkg diff --git a/bin/go b/bin/go index 477848979a..99e87832b4 120000 --- a/bin/go +++ b/bin/go @@ -1 +1 @@ -.go-1.25.5.pkg \ No newline at end of file +.go-1.26.1.pkg \ No newline at end of file diff --git a/bin/gofmt b/bin/gofmt index 477848979a..99e87832b4 120000 --- a/bin/gofmt +++ b/bin/gofmt @@ -1 +1 @@ -.go-1.25.5.pkg \ No newline at end of file +.go-1.26.1.pkg \ No newline at end of file diff --git a/bin/golangci-lint b/bin/golangci-lint index 536cc8d91e..8f48767257 120000 --- a/bin/golangci-lint +++ b/bin/golangci-lint @@ -1 +1 @@ -.golangci-lint-2.4.0.pkg \ No newline at end of file +.golangci-lint-2.11.3.pkg \ No newline at end of file diff --git a/docs/version.asciidoc b/docs/version.asciidoc index 29632ed1f7..570c415036 100644 --- a/docs/version.asciidoc +++ b/docs/version.asciidoc @@ -1,6 +1,6 @@ // doc-branch can be: master, 8.1, 8.2, etc. :doc-branch: master -:go-version: 1.25.4 +:go-version: 1.26.1 :python: 3.7 :docker: 1.12 :docker-compose: 1.11 diff --git a/go.mod b/go.mod index d734a486d3..192b5d3581 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/elastic/cloudbeat -go 1.25.5 +go 1.26.1 require ( cloud.google.com/go/asset v1.22.1 diff --git a/internal/resources/fetching/fetchers/azure/assets_enricher.go b/internal/resources/fetching/fetchers/azure/assets_enricher.go index 4b75b65a33..d42043fed9 100644 --- a/internal/resources/fetching/fetchers/azure/assets_enricher.go +++ b/internal/resources/fetching/fetchers/azure/assets_enricher.go @@ -30,7 +30,7 @@ type AssetsEnricher interface { } func initEnrichers(provider azurelib.ProviderAPI) []AssetsEnricher { - var enrichers []AssetsEnricher + enrichers := make([]AssetsEnricher, 0, 7) enrichers = append(enrichers, storageAccountEnricher{provider: provider}) enrichers = append(enrichers, vmNetworkSecurityGroupEnricher{}) diff --git a/internal/resources/providers/awslib/rds/provider.go b/internal/resources/providers/awslib/rds/provider.go index f1d133d6e5..bffbb5d88b 100644 --- a/internal/resources/providers/awslib/rds/provider.go +++ b/internal/resources/providers/awslib/rds/provider.go @@ -91,7 +91,7 @@ func (p Provider) getDBInstanceSubnets(ctx context.Context, region string, dbIns if err != nil { p.log.Errorf("Could not get route table for subnet %s of DB %s. Error: %v", *subnet.SubnetIdentifier, *dbInstance.DBInstanceIdentifier, err) } else { - var routes []Route + routes := make([]Route, 0, len(routeTableForSubnet.Routes)) for _, route := range routeTableForSubnet.Routes { routes = append(routes, Route{DestinationCidrBlock: route.DestinationCidrBlock, GatewayId: route.GatewayId}) } diff --git a/internal/resources/providers/gcplib/inventory/provider.go b/internal/resources/providers/gcplib/inventory/provider.go index 4422807019..954729582f 100644 --- a/internal/resources/providers/gcplib/inventory/provider.go +++ b/internal/resources/providers/gcplib/inventory/provider.go @@ -453,7 +453,7 @@ func findDnsPolicyByNetwork(dnsPolicies []*dnsPolicyFields, networkIdentifier st } func decodeDnsPolicies(dnsPolicyAssets []*assetpb.Asset) []*dnsPolicyFields { - dnsPolicies := make([]*dnsPolicyFields, 0) + dnsPolicies := make([]*dnsPolicyFields, 0, len(dnsPolicyAssets)) for _, dnsPolicyAsset := range dnsPolicyAssets { fields := new(dnsPolicyFields) dnsPolicyData := dnsPolicyAsset.GetResource().GetData().GetFields() diff --git a/scripts/update_assets_md/go.mod b/scripts/update_assets_md/go.mod index 4e0fa2417b..ec285a5c5c 100644 --- a/scripts/update_assets_md/go.mod +++ b/scripts/update_assets_md/go.mod @@ -1,6 +1,6 @@ module github.com/elastic/cloudbeat/scripts/update_assets_md -go 1.24.0 +go 1.26.1 require ( github.com/ettle/strcase v0.2.0