Skip to content

Commit

Permalink
Bump Go to v1.22(.6) and golangci to v1.60.3 (#485)
Browse files Browse the repository at this point in the history
* Bump Go to v1.22(.6) and golangci to v1.60.3

Signed-off-by: Caleb Brown <calebbrown@google.com>

* Fix golangci issues

Signed-off-by: Caleb Brown <calebbrown@google.com>

* Typo in dockerfile

Signed-off-by: Caleb Brown <calebbrown@google.com>

* Fix lint errors

Signed-off-by: Caleb Brown <calebbrown@google.com>

* Fix more linter errors

Signed-off-by: Caleb Brown <calebbrown@google.com>

* Fix even more lint errors

Signed-off-by: Caleb Brown <calebbrown@google.com>

* Fix some more lint errors.

Signed-off-by: Caleb Brown <calebbrown@google.com>

---------

Signed-off-by: Caleb Brown <calebbrown@google.com>
  • Loading branch information
calebbrown authored Aug 29, 2024
1 parent 3fb6968 commit ecb851c
Show file tree
Hide file tree
Showing 21 changed files with 62 additions and 43 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: '1.20'
go-version: '1.22'

- name: Run tests
run: go test -v -skip TestPyPIArtifactsLive ./...
Expand All @@ -39,7 +39,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: '1.20'
go-version: '1.22'

- name: Build
run: make build
Expand Down
12 changes: 3 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ linters:
enable:
- asciicheck
- bodyclose
- deadcode
- copyloopvar
#- depguard
- dogsled
- dupl
- err113
- errcheck
- errorlint
- exhaustive
- exportloopref
- gci
- gochecknoinits
- gocognit
Expand All @@ -23,43 +23,37 @@ linters:
- gocyclo
- godot
- godox
- goerr113
- gofmt
- gofumpt
- goheader
- goimports
- golint
# - gomnd
- gomodguard
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- lll
- makezero
- maligned
- misspell
- nakedret
- nestif
- nolintlint
- paralleltest
- prealloc
- predeclared
- revive
- rowserrcheck
- scopelint
- sqlclosecheck
- staticcheck
- structcheck
- stylecheck
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- varcheck
- whitespace
# - wrapcheck
# - exhaustivestruct
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Originally modified from the main Cloud Run documentation

FROM golang:1.20.5-buster@sha256:eb3f9ac805435c1b2c965d63ce460988e1000058e1f67881324746362baf9572 as builder
FROM golang:1.22.6-bookworm@sha256:f020456572fc292e9627b3fb435c6de5dfb8020fbcef1fd7b65dd092c0ac56bb AS builder

# Create and change to the app directory.
WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GO ?= go
BIN := bin
GOOS ?= $(shell uname | tr A-Z a-z)
GOLANGCI_LINT_VERSION = v1.53.3
GOLANGCI_LINT_VERSION = v1.60.3
PROJECT := package-feeds

.PHONY: help
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/ossf/package-feeds

go 1.20
go 1.22

require (
github.com/hashicorp/golang-lru/v2 v2.0.7
Expand Down
25 changes: 25 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM=
cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4=
cloud.google.com/go/compute v1.25.0 h1:H1/4SqSUhjPFE7L5ddzHOfY2bCAvjwNRZPNl6Ni5oYU=
cloud.google.com/go/compute v1.25.0/go.mod h1:GR7F0ZPZH8EhChlMo9FkLd7eUTwEymjqQagxzilIxIE=
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
Expand All @@ -12,19 +13,33 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/IBM/sarama v1.43.0 h1:YFFDn8mMI2QL0wOrG0J2sFoVIAFl7hS9JQi2YZsXtJc=
github.com/IBM/sarama v1.43.0/go.mod h1:zlE6HEbC/SMQ9mhEYaF7nNLYOUyrs0obySKCckWP9BM=
github.com/aws/aws-sdk-go v1.50.36 h1:PjWXHwZPuTLMR1NIb8nEjLucZBMzmf84TLoLbD8BZqk=
github.com/aws/aws-sdk-go v1.50.36/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/aws/aws-sdk-go-v2 v1.25.3 h1:xYiLpZTQs1mzvz5PaI6uR0Wh57ippuEthxS4iK5v0n0=
github.com/aws/aws-sdk-go-v2 v1.25.3/go.mod h1:35hUlJVYd+M++iLI3ALmVwMOyRYMmRqUXpTtRGW+K9I=
github.com/aws/aws-sdk-go-v2/config v1.27.7 h1:JSfb5nOQF01iOgxFI5OIKWwDiEXWTyTgg1Mm1mHi0A4=
github.com/aws/aws-sdk-go-v2/config v1.27.7/go.mod h1:PH0/cNpoMO+B04qET699o5W92Ca79fVtbUnvMIZro4I=
github.com/aws/aws-sdk-go-v2/credentials v1.17.7 h1:WJd+ubWKoBeRh7A5iNMnxEOs982SyVKOJD+K8HIezu4=
github.com/aws/aws-sdk-go-v2/credentials v1.17.7/go.mod h1:UQi7LMR0Vhvs+44w5ec8Q+VS+cd10cjwgHwiVkE0YGU=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.3 h1:p+y7FvkK2dxS+FEwRIDHDe//ZX+jDhP8HHE50ppj4iI=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.3/go.mod h1:/fYB+FZbDlwlAiynK9KDXlzZl3ANI9JkD0Uhz5FjNT4=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.3 h1:ifbIbHZyGl1alsAhPIYsHOg5MuApgqOvVeI8wIugXfs=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.3/go.mod h1:oQZXg3c6SNeY6OZrDY+xHcF4VGIEoNotX2B4PrDeoJI=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.3 h1:Qvodo9gHG9F3E8SfYOspPeBt0bjSbsevK8WhRAUHcoY=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.3/go.mod h1:vCKrdLXtybdf/uQd/YfVR2r5pcbNuEYKzMQpcxmeSJw=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 h1:EyBZibRTVAs6ECHZOw5/wlylS9OcTzwyjeQMudmREjE=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1/go.mod h1:JKpmtYhhPs7D97NL/ltqz7yCkERFW5dOlHyVl66ZYF8=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.5 h1:K/NXvIftOlX+oGgWGIa3jDyYLDNsdVhsjHmsBH2GLAQ=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.5/go.mod h1:cl9HGLV66EnCmMNzq4sYOti+/xo8w34CsgzVtm2GgsY=
github.com/aws/aws-sdk-go-v2/service/sso v1.20.2 h1:XOPfar83RIRPEzfihnp+U6udOveKZJvPQ76SKWrLRHc=
github.com/aws/aws-sdk-go-v2/service/sso v1.20.2/go.mod h1:Vv9Xyk1KMHXrR3vNQe8W5LMFdTjSeWk0gBZBzvf3Qa0=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.2 h1:pi0Skl6mNl2w8qWZXcdOyg197Zsf4G97U7Sso9JXGZE=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.2/go.mod h1:JYzLoEVeLXk+L4tn1+rrkfhkxl6mLDEVaDSvGq9og90=
github.com/aws/aws-sdk-go-v2/service/sts v1.28.4 h1:Ppup1nVNAOWbBOrcoOxaxPeEnSFB2RnnQdguhXpmeQk=
github.com/aws/aws-sdk-go-v2/service/sts v1.28.4/go.mod h1:+K1rNPVyGxkRuv9NNiaZ4YhBFuyw2MMA9SlIJ1Zlpz8=
github.com/aws/smithy-go v1.20.1 h1:4SZlSlMr36UEqC7XOyRVb27XMeZubNcBNN+9IgEPIQw=
github.com/aws/smithy-go v1.20.1/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
Expand All @@ -45,6 +60,7 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
Expand Down Expand Up @@ -78,9 +94,13 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-replayers/grpcreplay v1.1.0 h1:S5+I3zYyZ+GQz68OfbURDdt/+cSMqCK1wrvNx7WBzTE=
github.com/google/go-replayers/grpcreplay v1.1.0/go.mod h1:qzAvJ8/wi57zq7gWqaE6AwLM6miiXUQwP1S+I9icmhk=
github.com/google/go-replayers/httpreplay v1.2.0 h1:VM1wEyyjaoU53BwrOnaf9VhAyQQEEioJvFYxYcLRKzk=
github.com/google/go-replayers/httpreplay v1.2.0/go.mod h1:WahEFFZZ7a1P4VM1qEeHy+tME4bwyqPcwWbNlUI1Mcg=
github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw=
github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw=
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
Expand Down Expand Up @@ -116,11 +136,13 @@ github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP
github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY=
github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg=
github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b h1:udzkj9S/zlT5X367kqJis0QP7YMxobob6zhzq6Yre00=
github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b/go.mod h1:pcaDhQK0/NJZEvtCO0qQPPropqV0sJOJ6YW7X+9kRwM=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
Expand Down Expand Up @@ -148,6 +170,7 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
Expand All @@ -166,6 +189,7 @@ go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi
go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc=
go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
gocloud.dev v0.37.0 h1:XF1rN6R0qZI/9DYjN16Uy0durAmSlf58DHOcb28GPro=
Expand Down Expand Up @@ -299,6 +323,7 @@ google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGm
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
2 changes: 1 addition & 1 deletion pkg/feeds/crates/crates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func TestCratesNotFound(t *testing.T) {
}
}

func cratesSummaryResponse(w http.ResponseWriter, r *http.Request) {
func cratesSummaryResponse(w http.ResponseWriter, _ *http.Request) {
_, err := w.Write([]byte(`
{
"just_updated": [
Expand Down
2 changes: 1 addition & 1 deletion pkg/feeds/goproxy/goproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestGoproxyNotFound(t *testing.T) {
}
}

func goproxyPackageResponse(w http.ResponseWriter, r *http.Request) {
func goproxyPackageResponse(w http.ResponseWriter, _ *http.Request) {
_, err := w.Write([]byte(`{"Path": "golang.org/x/foo","Version": "v0.3.0","Timestamp": "2019-04-10T19:08:52.997264Z"}
{"Path": "golang.org/x/bar","Version": "v0.4.0","Timestamp": "2019-04-10T20:30:02.04035Z"}
`))
Expand Down
2 changes: 1 addition & 1 deletion pkg/feeds/maven/maven_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestMavenNotFound(t *testing.T) {
}
}

func mavenPackageResponse(w http.ResponseWriter, r *http.Request) {
func mavenPackageResponse(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-Type", "application/json")
responseJSON := `
{
Expand Down
16 changes: 8 additions & 8 deletions pkg/feeds/npm/npm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ func TestNpmCriticalPartialNotFound(t *testing.T) {
}
}

func npmLatestPackagesResponse(w http.ResponseWriter, r *http.Request) {
func npmLatestPackagesResponse(w http.ResponseWriter, _ *http.Request) {
_, err := w.Write([]byte(`
<?xml version="1.0" encoding="UTF-8"?><rss>
<channel>
Expand Down Expand Up @@ -425,7 +425,7 @@ func npmLatestPackagesResponse(w http.ResponseWriter, r *http.Request) {
}
}

func fooVersionInfoResponse(w http.ResponseWriter, r *http.Request) {
func fooVersionInfoResponse(w http.ResponseWriter, _ *http.Request) {
_, err := w.Write([]byte(`
{
"name": "FooPackage",
Expand All @@ -447,7 +447,7 @@ func fooVersionInfoResponse(w http.ResponseWriter, r *http.Request) {
}
}

func barVersionInfoResponse(w http.ResponseWriter, r *http.Request) {
func barVersionInfoResponse(w http.ResponseWriter, _ *http.Request) {
_, err := w.Write([]byte(`
{
"name": "BarPackage",
Expand All @@ -470,7 +470,7 @@ func barVersionInfoResponse(w http.ResponseWriter, r *http.Request) {

// BazPackage has 2 entries in the registry rss, as such it should result
// in both tags being resolved, in date order.
func bazVersionInfoResponse(w http.ResponseWriter, r *http.Request) {
func bazVersionInfoResponse(w http.ResponseWriter, _ *http.Request) {
_, err := w.Write([]byte(`
{
"name": "BazPackage",
Expand All @@ -494,7 +494,7 @@ func bazVersionInfoResponse(w http.ResponseWriter, r *http.Request) {
// the 'firehose' but a *feeds.Package{} should not be generated. Completely
// unpublishing a package entails there's a minimum of 24hours before a new version
// of it may be published.
func quxVersionInfoResponse(w http.ResponseWriter, r *http.Request) {
func quxVersionInfoResponse(w http.ResponseWriter, _ *http.Request) {
_, err := w.Write([]byte(`
{
"name": "QuxPackage",
Expand Down Expand Up @@ -524,7 +524,7 @@ func quxVersionInfoResponse(w http.ResponseWriter, r *http.Request) {
// were to happen for a single registry entry (count == 1), then the
// `cutoff` should handle older than expected versions being mistakenly
// processed, assuming it was not completely unpublished.
func quuxVersionInfoResponse(w http.ResponseWriter, r *http.Request) {
func quuxVersionInfoResponse(w http.ResponseWriter, _ *http.Request) {
_, err := w.Write([]byte(`
{
"name": "QuuxPackage",
Expand All @@ -543,7 +543,7 @@ func quuxVersionInfoResponse(w http.ResponseWriter, r *http.Request) {
}
}

func nonUtf8Response(w http.ResponseWriter, r *http.Request) {
func nonUtf8Response(w http.ResponseWriter, _ *http.Request) {
_, err := w.Write([]byte(`
<?xml version="1.0" encoding="UTF-8"?><rss>
<channel>
Expand All @@ -563,7 +563,7 @@ func nonUtf8Response(w http.ResponseWriter, r *http.Request) {
}
}

func nonXMLResponse(w http.ResponseWriter, r *http.Request) {
func nonXMLResponse(w http.ResponseWriter, _ *http.Request) {
nonXMLChars := "\u0002\u0010\u0014\u0016\u001b\u0000"
xml := `
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0">
Expand Down
8 changes: 4 additions & 4 deletions pkg/feeds/nuget/nuget_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestCanParseFeed(t *testing.T) {
}
}

func indexMock(w http.ResponseWriter, r *http.Request) {
func indexMock(w http.ResponseWriter, _ *http.Request) {
var err error
catalogEndpoint, err := makeTestURL("v3/catalog0/index.json")
if err != nil {
Expand All @@ -89,7 +89,7 @@ func indexMock(w http.ResponseWriter, r *http.Request) {
}
}

func catalogMock(w http.ResponseWriter, r *http.Request) {
func catalogMock(w http.ResponseWriter, _ *http.Request) {
var err error
pageEndpoint, err := makeTestURL("v3/catalog0/page1.json")
if err != nil {
Expand All @@ -104,7 +104,7 @@ func catalogMock(w http.ResponseWriter, r *http.Request) {
}
}

func catalogPageMock(w http.ResponseWriter, r *http.Request) {
func catalogPageMock(w http.ResponseWriter, _ *http.Request) {
var err error
pkgAdded := "nuget:PackageDetails"
pkgDeleted := "nuget:PackageDelete"
Expand Down Expand Up @@ -145,7 +145,7 @@ func catalogPageMock(w http.ResponseWriter, r *http.Request) {
}
}

func packageDetailMock(w http.ResponseWriter, r *http.Request) {
func packageDetailMock(w http.ResponseWriter, _ *http.Request) {
response := fmt.Sprintf(`{"id": "new.expected.package", "version": "0.0.1", "published": "%s"}`,
time.Now().UTC().Add(-1*time.Minute).Format(time.RFC3339))

Expand Down
6 changes: 3 additions & 3 deletions pkg/feeds/pypi/pypi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func TestPypiCriticalPartialNotFound(t *testing.T) {
}

// Mock data for pypi firehose with all packages.
func updatesXMLHandle(w http.ResponseWriter, r *http.Request) {
func updatesXMLHandle(w http.ResponseWriter, _ *http.Request) {
_, err := w.Write([]byte(`
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
Expand Down Expand Up @@ -222,7 +222,7 @@ func updatesXMLHandle(w http.ResponseWriter, r *http.Request) {

// Mock data response for package specific api when pypi is configured with
// a package list in FeedOptions.
func foopyReleasesResponse(w http.ResponseWriter, r *http.Request) {
func foopyReleasesResponse(w http.ResponseWriter, _ *http.Request) {
_, err := w.Write([]byte(`
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
Expand Down Expand Up @@ -251,7 +251,7 @@ func foopyReleasesResponse(w http.ResponseWriter, r *http.Request) {

// Mock data response for package specific api when pypi is configured with
// a package list in FeedOptions.
func barpyReleasesResponse(w http.ResponseWriter, r *http.Request) {
func barpyReleasesResponse(w http.ResponseWriter, _ *http.Request) {
_, err := w.Write([]byte(`
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
Expand Down
2 changes: 1 addition & 1 deletion pkg/feeds/rubygems/rubygems_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func TestRubyGemsPartialNotFound(t *testing.T) {
}
}

func rubyGemsPackagesResponse(w http.ResponseWriter, r *http.Request) {
func rubyGemsPackagesResponse(w http.ResponseWriter, _ *http.Request) {
_, err := w.Write([]byte(`
[
{
Expand Down
2 changes: 1 addition & 1 deletion pkg/publisher/gcppubsub/gcppubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Config struct {
}

func New(ctx context.Context, url string) (*GCPPubSub, error) {
topic, err := pubsub.OpenTopic(context.TODO(), url)
topic, err := pubsub.OpenTopic(ctx, url)
if err != nil {
return nil, err
}
Expand Down
Loading

0 comments on commit ecb851c

Please sign in to comment.