From dfbb4e85df9307e14261d4362b7b34287b8cb449 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 11:27:15 +0000 Subject: [PATCH 1/8] deps(tools): bump github.com/golangci/golangci-lint in /tools Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.54.2 to 1.55.0. - [Release notes](https://github.com/golangci/golangci-lint/releases) - [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md) - [Commits](https://github.com/golangci/golangci-lint/compare/v1.54.2...v1.55.0) --- updated-dependencies: - dependency-name: github.com/golangci/golangci-lint dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tools/go.mod | 56 ++++++++++++---------- tools/go.sum | 128 +++++++++++++++++++++++++++++---------------------- 2 files changed, 103 insertions(+), 81 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index b55452b10..42e6e4923 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -5,7 +5,7 @@ go 1.21.3 require ( github.com/canonical/ubuntu-pro-for-windows/windows-agent v0.0.0-20230906090052-60fb5d60ada4 github.com/canonical/ubuntu-pro-for-windows/wsl-pro-service v0.0.0-20230906090052-60fb5d60ada4 - github.com/golangci/golangci-lint v1.54.2 + github.com/golangci/golangci-lint v1.55.0 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 golang.org/x/vuln v1.0.1 @@ -22,15 +22,17 @@ require ( require ( 4d63.com/gocheckcompilerdirectives v1.2.1 // indirect 4d63.com/gochecknoglobals v0.2.1 // indirect - github.com/4meepo/tagalign v1.3.2 // indirect - github.com/Abirdcfly/dupword v0.0.12 // indirect + github.com/4meepo/tagalign v1.3.3 // indirect + github.com/Abirdcfly/dupword v0.0.13 // indirect github.com/Antonboom/errname v0.1.12 // indirect github.com/Antonboom/nilnil v0.1.7 // indirect + github.com/Antonboom/testifylint v0.2.3 // indirect github.com/BurntSushi/toml v1.3.2 // indirect github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect github.com/GaijinEntertainment/go-exhaustruct/v3 v3.1.0 // indirect github.com/Masterminds/semver v1.5.0 // indirect github.com/OpenPeeDeeP/depguard/v2 v2.1.0 // indirect + github.com/alecthomas/go-check-sumtype v0.1.3 // indirect github.com/alexkohler/nakedret/v2 v2.0.2 // indirect github.com/alexkohler/prealloc v1.0.0 // indirect github.com/alingse/asasalint v0.0.11 // indirect @@ -40,9 +42,9 @@ require ( github.com/bkielbasa/cyclop v1.2.1 // indirect github.com/blizzy78/varnamelen v0.8.0 // indirect github.com/bombsimon/wsl/v3 v3.4.0 // indirect - github.com/breml/bidichk v0.2.4 // indirect - github.com/breml/errchkjson v0.3.1 // indirect - github.com/butuzov/ireturn v0.2.0 // indirect + github.com/breml/bidichk v0.2.7 // indirect + github.com/breml/errchkjson v0.3.6 // indirect + github.com/butuzov/ireturn v0.2.1 // indirect github.com/butuzov/mirror v1.1.0 // indirect github.com/canonical/landscape-hostagent-api v0.0.0-20230606055347-dd0b7f618303 // indirect github.com/canonical/ubuntu-pro-for-windows/agentapi v0.0.0-20230906090052-60fb5d60ada4 // indirect @@ -50,14 +52,15 @@ require ( github.com/canonical/ubuntu-pro-for-windows/contractsapi v0.0.0-20230906090052-60fb5d60ada4 // indirect github.com/canonical/ubuntu-pro-for-windows/mocks v0.0.0-20230906090052-60fb5d60ada4 // indirect github.com/canonical/ubuntu-pro-for-windows/wslserviceapi v0.0.0-20230906090052-60fb5d60ada4 // indirect + github.com/catenacyber/perfsprint v0.2.0 // indirect github.com/ccojocar/zxcvbn-go v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/charithe/durationcheck v0.0.10 // indirect - github.com/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8 // indirect + github.com/chavacava/garif v0.1.0 // indirect github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/curioswitch/go-reassign v0.2.0 // indirect - github.com/daixiang0/gci v0.11.0 // indirect + github.com/daixiang0/gci v0.11.2 // indirect github.com/denis-tingaikin/go-header v0.4.3 // indirect github.com/esimonov/ifshort v1.0.4 // indirect github.com/ettle/strcase v0.1.1 // indirect @@ -66,6 +69,7 @@ require ( github.com/firefart/nonamedreturns v1.0.4 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect + github.com/ghostiam/protogetter v0.2.3 // indirect github.com/go-critic/go-critic v0.9.0 // indirect github.com/go-toolsmith/astcast v1.1.0 // indirect github.com/go-toolsmith/astcopy v1.1.0 // indirect @@ -81,11 +85,11 @@ require ( github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe // indirect - github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2 // indirect + github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e // indirect github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 // indirect github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca // indirect github.com/golangci/misspell v0.4.1 // indirect - github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 // indirect + github.com/golangci/revgrep v0.5.0 // indirect github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/uuid v1.3.1 // indirect @@ -100,7 +104,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/jgautheron/goconst v1.5.1 // indirect + github.com/jgautheron/goconst v1.6.0 // indirect github.com/jingyugao/rowserrcheck v1.1.1 // indirect github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect github.com/julz/importas v0.1.0 // indirect @@ -114,6 +118,7 @@ require ( github.com/ldez/tagliatelle v0.5.0 // indirect github.com/leonklingele/grouper v1.1.1 // indirect github.com/lufeee/execinquery v1.2.1 // indirect + github.com/macabu/inamedparam v0.1.2 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/maratori/testableexamples v1.0.0 // indirect github.com/maratori/testpackage v1.1.1 // indirect @@ -123,17 +128,17 @@ require ( github.com/mattn/go-runewidth v0.0.9 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mbilski/exhaustivestruct v1.2.0 // indirect - github.com/mgechev/revive v1.3.2 // indirect + github.com/mgechev/revive v1.3.4 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moricho/tparallel v0.3.1 // indirect github.com/nakabonne/nestif v0.3.1 // indirect github.com/nishanths/exhaustive v0.11.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect - github.com/nunnatsa/ginkgolinter v0.13.5 // indirect + github.com/nunnatsa/ginkgolinter v0.14.0 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/polyfloyd/go-errorlint v1.4.4 // indirect + github.com/polyfloyd/go-errorlint v1.4.5 // indirect github.com/prometheus/client_golang v1.12.1 // indirect github.com/prometheus/client_model v0.4.0 // indirect github.com/prometheus/common v0.32.1 // indirect @@ -144,13 +149,13 @@ require ( github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/ryancurrah/gomodguard v1.3.0 // indirect - github.com/ryanrolds/sqlclosecheck v0.4.0 // indirect + github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect github.com/sagikazarmark/locafero v0.3.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect github.com/sashamelentyev/interfacebloat v1.1.0 // indirect github.com/sashamelentyev/usestdlibvars v1.24.0 // indirect - github.com/securego/gosec/v2 v2.17.0 // indirect + github.com/securego/gosec/v2 v2.18.1 // indirect github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/sivchari/containedctx v1.0.3 // indirect @@ -170,7 +175,7 @@ require ( github.com/subosito/gotenv v1.6.0 // indirect github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect github.com/tdakkota/asciicheck v0.2.0 // indirect - github.com/tetafro/godot v1.4.14 // indirect + github.com/tetafro/godot v1.4.15 // indirect github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 // indirect github.com/timonwong/loggercheck v0.9.4 // indirect github.com/tomarrell/wrapcheck/v2 v2.8.1 // indirect @@ -179,29 +184,30 @@ require ( github.com/ubuntu/gowsl v0.0.0-20231004124730-8fd8df02f394 // indirect github.com/ultraware/funlen v0.1.0 // indirect github.com/ultraware/whitespace v0.0.5 // indirect - github.com/uudashr/gocognit v1.0.7 // indirect - github.com/xen0n/gosmopolitan v1.2.1 // indirect + github.com/uudashr/gocognit v1.1.2 // indirect + github.com/xen0n/gosmopolitan v1.2.2 // indirect github.com/yagipy/maintidx v1.0.0 // indirect github.com/yeya24/promlinter v0.2.0 // indirect github.com/ykadowak/zerologlint v0.1.3 // indirect - gitlab.com/bosi/decorder v0.4.0 // indirect + gitlab.com/bosi/decorder v0.4.1 // indirect + go-simpler.org/sloglint v0.1.2 // indirect go.tmz.dev/musttag v0.7.2 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.9.0 // indirect go.uber.org/zap v1.24.0 // indirect golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect - golang.org/x/mod v0.12.0 // indirect - golang.org/x/net v0.15.0 // indirect - golang.org/x/sync v0.3.0 // indirect + golang.org/x/mod v0.13.0 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/sync v0.4.0 // indirect golang.org/x/sys v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect - golang.org/x/tools v0.13.0 // indirect + golang.org/x/tools v0.14.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect google.golang.org/grpc v1.58.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - honnef.co/go/tools v0.4.5 // indirect + honnef.co/go/tools v0.4.6 // indirect mvdan.cc/gofumpt v0.5.0 // indirect mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect diff --git a/tools/go.sum b/tools/go.sum index 884bb9154..24f1bf66f 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -42,14 +42,16 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/0xrawsec/golang-utils v1.3.2 h1:ww4jrtHRSnX9xrGzJYbalx5nXoZewy4zPxiY+ubJgtg= github.com/0xrawsec/golang-utils v1.3.2/go.mod h1:m7AzHXgdSAkFCD9tWWsApxNVxMlyy7anpPVOyT/yM7E= -github.com/4meepo/tagalign v1.3.2 h1:1idD3yxlRGV18VjqtDbqYvQ5pXqQS0wO2dn6M3XstvI= -github.com/4meepo/tagalign v1.3.2/go.mod h1:Q9c1rYMZJc9dPRkbQPpcBNCLEmY2njbAsXhQOZFE2dE= -github.com/Abirdcfly/dupword v0.0.12 h1:56NnOyrXzChj07BDFjeRA+IUzSz01jmzEq+G4kEgFhc= -github.com/Abirdcfly/dupword v0.0.12/go.mod h1:+us/TGct/nI9Ndcbcp3rgNcQzctTj68pq7TcgNpLfdI= +github.com/4meepo/tagalign v1.3.3 h1:ZsOxcwGD/jP4U/aw7qeWu58i7dwYemfy5Y+IF1ACoNw= +github.com/4meepo/tagalign v1.3.3/go.mod h1:Q9c1rYMZJc9dPRkbQPpcBNCLEmY2njbAsXhQOZFE2dE= +github.com/Abirdcfly/dupword v0.0.13 h1:SMS17YXypwP000fA7Lr+kfyBQyW14tTT+nRv9ASwUUo= +github.com/Abirdcfly/dupword v0.0.13/go.mod h1:Ut6Ue2KgF/kCOawpW4LnExT+xZLQviJPE4klBPMK/5Y= github.com/Antonboom/errname v0.1.12 h1:oh9ak2zUtsLp5oaEd/erjB4GPu9w19NyoIskZClDcQY= github.com/Antonboom/errname v0.1.12/go.mod h1:bK7todrzvlaZoQagP1orKzWXv59X/x0W0Io2XT1Ssro= github.com/Antonboom/nilnil v0.1.7 h1:ofgL+BA7vlA1K2wNQOsHzLJ2Pw5B5DpWRLdDAVvvTow= github.com/Antonboom/nilnil v0.1.7/go.mod h1:TP+ScQWVEq0eSIxqU8CbdT5DFWoHp0MbP+KMUO1BKYQ= +github.com/Antonboom/testifylint v0.2.3 h1:MFq9zyL+rIVpsvLX4vDPLojgN7qODzWsrnftNX2Qh60= +github.com/Antonboom/testifylint v0.2.3/go.mod h1:IYaXaOX9NbfAyO+Y04nfjGI8wDemC1rUyM/cYolz018= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= @@ -62,6 +64,12 @@ github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3Q github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/OpenPeeDeeP/depguard/v2 v2.1.0 h1:aQl70G173h/GZYhWf36aE5H0KaujXfVMnn/f1kSDVYY= github.com/OpenPeeDeeP/depguard/v2 v2.1.0/go.mod h1:PUBgk35fX4i7JDmwzlJwJ+GMe6NfO1723wmJMgPThNQ= +github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk= +github.com/alecthomas/assert/v2 v2.2.2/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= +github.com/alecthomas/go-check-sumtype v0.1.3 h1:M+tqMxB68hcgccRXBMVCPI4UJ+QUfdSx0xdbypKCqA8= +github.com/alecthomas/go-check-sumtype v0.1.3/go.mod h1:WyYPfhfkdhyrdaligV6svFopZV8Lqdzn5pyVBaV6jhQ= +github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk= +github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -89,12 +97,12 @@ github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= github.com/bombsimon/wsl/v3 v3.4.0 h1:RkSxjT3tmlptwfgEgTgU+KYKLI35p/tviNXNXiL2aNU= github.com/bombsimon/wsl/v3 v3.4.0/go.mod h1:KkIB+TXkqy6MvK9BDZVbZxKNYsE1/oLRJbIFtf14qqo= -github.com/breml/bidichk v0.2.4 h1:i3yedFWWQ7YzjdZJHnPo9d/xURinSq3OM+gyM43K4/8= -github.com/breml/bidichk v0.2.4/go.mod h1:7Zk0kRFt1LIZxtQdl9W9JwGAcLTTkOs+tN7wuEYGJ3s= -github.com/breml/errchkjson v0.3.1 h1:hlIeXuspTyt8Y/UmP5qy1JocGNR00KQHgfaNtRAjoxQ= -github.com/breml/errchkjson v0.3.1/go.mod h1:XroxrzKjdiutFyW3nWhw34VGg7kiMsDQox73yWCGI2U= -github.com/butuzov/ireturn v0.2.0 h1:kCHi+YzC150GE98WFuZQu9yrTn6GEydO2AuPLbTgnO4= -github.com/butuzov/ireturn v0.2.0/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc= +github.com/breml/bidichk v0.2.7 h1:dAkKQPLl/Qrk7hnP6P+E0xOodrq8Us7+U0o4UBOAlQY= +github.com/breml/bidichk v0.2.7/go.mod h1:YodjipAGI9fGcYM7II6wFvGhdMYsC5pHDlGzqvEW3tQ= +github.com/breml/errchkjson v0.3.6 h1:VLhVkqSBH96AvXEyclMR37rZslRrY2kcyq+31HCsVrA= +github.com/breml/errchkjson v0.3.6/go.mod h1:jhSDoFheAF2RSDOlCfhHO9KqhZgAYLyvHe7bRCX8f/U= +github.com/butuzov/ireturn v0.2.1 h1:w5Ks4tnfeFDZskGJ2x1GAkx5gaQV+kdU3NKNr3NEBzY= +github.com/butuzov/ireturn v0.2.1/go.mod h1:RfGHUvvAuFFxoHKf4Z8Yxuh6OjlCw1KvR2zM1NFHeBk= github.com/butuzov/mirror v1.1.0 h1:ZqX54gBVMXu78QLoiqdwpl2mgmoOJTk7s4p4o+0avZI= github.com/butuzov/mirror v1.1.0/go.mod h1:8Q0BdQU6rC6WILDiBM60DBfvV78OLJmMmixe7GF45AE= github.com/canonical/landscape-hostagent-api v0.0.0-20230606055347-dd0b7f618303 h1:YfGTcFs5YaJlpR0lxVAPD3oFYcez9Pg1w0MUEbG2zB0= @@ -113,6 +121,8 @@ github.com/canonical/ubuntu-pro-for-windows/wsl-pro-service v0.0.0-2023090609005 github.com/canonical/ubuntu-pro-for-windows/wsl-pro-service v0.0.0-20230906090052-60fb5d60ada4/go.mod h1:3kBtVL9aGffHlXWSxkP4qrT+Q5xHIl3VybPCFsxRxbI= github.com/canonical/ubuntu-pro-for-windows/wslserviceapi v0.0.0-20230906090052-60fb5d60ada4 h1:vvFUurP/iXkNIRJG6kAHffAXLGQB3R3PzbEeEg2RY3Q= github.com/canonical/ubuntu-pro-for-windows/wslserviceapi v0.0.0-20230906090052-60fb5d60ada4/go.mod h1:GEtgc3YqISt1slWIVqdIz2Wh7mrWLIyFbsug3+m180Y= +github.com/catenacyber/perfsprint v0.2.0 h1:azOocHLscPjqXVJ7Mf14Zjlkn4uNua0+Hcg1wTR6vUo= +github.com/catenacyber/perfsprint v0.2.0/go.mod h1:/wclWYompEyjUD2FuIIDVKNkqz7IgBIWXIH3V0Zol50= github.com/ccojocar/zxcvbn-go v1.0.1 h1:+sxrANSCj6CdadkcMnvde/GWU1vZiiXRbqYSCalV4/4= github.com/ccojocar/zxcvbn-go v1.0.1/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQdw6Qnz/hi60= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -122,8 +132,8 @@ github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/charithe/durationcheck v0.0.10 h1:wgw73BiocdBDQPik+zcEoBG/ob8uyBHf2iyoHGPf5w4= github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoGOY1C1L6uouGNreQ= -github.com/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8 h1:W9o46d2kbNL06lq7UNDPV0zYLzkrde/bjIqO02eoll0= -github.com/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8/go.mod h1:gakxgyXaaPkxvLw1XQxNGK4I37ys9iBRzNUx/B7pUCo= +github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= +github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -137,8 +147,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHH github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= -github.com/daixiang0/gci v0.11.0 h1:XeQbFKkCRxvVyn06EOuNY6LPGBLVuB/W130c8FrnX6A= -github.com/daixiang0/gci v0.11.0/go.mod h1:xtHP9N7AHdNvtRNfcx9gwTDfw7FRJx4bZUsiEfiNNAI= +github.com/daixiang0/gci v0.11.2 h1:Oji+oPsp3bQ6bNNgX30NBAVT18P4uBH4sRZnlOlTj7Y= +github.com/daixiang0/gci v0.11.2/go.mod h1:xtHP9N7AHdNvtRNfcx9gwTDfw7FRJx4bZUsiEfiNNAI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -167,6 +177,8 @@ github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4 github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= +github.com/ghostiam/protogetter v0.2.3 h1:qdv2pzo3BpLqezwqfGDLZ+nHEYmc5bUpIdsMbBVwMjw= +github.com/ghostiam/protogetter v0.2.3/go.mod h1:KmNLOsy1v04hKbvZs8EfGI1fk39AgTdRDxWNYPfXVc4= github.com/go-critic/go-critic v0.9.0 h1:Pmys9qvU3pSML/3GEQ2Xd9RZ/ip+aXHKILuxczKGV/U= github.com/go-critic/go-critic v0.9.0/go.mod h1:5P8tdXL7m/6qnyG6oRAlYLORvoXH0WDypYgAEmagT40= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -243,18 +255,18 @@ github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9 github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe h1:6RGUuS7EGotKx6J5HIP8ZtyMdiDscjMLfRBSPuzVVeo= github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe/go.mod h1:gjqyPShc/m8pEMpk0a3SeagVb0kaqvhscv+i9jI5ZhQ= -github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2 h1:amWTbTGqOZ71ruzrdA+Nx5WA3tV1N0goTspwmKCQvBY= -github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2/go.mod h1:9wOXstvyDRshQ9LggQuzBCGysxs3b6Uo/1MvYCR2NMs= -github.com/golangci/golangci-lint v1.54.2 h1:oR9zxfWYxt7hFqk6+fw6Enr+E7F0SN2nqHhJYyIb0yo= -github.com/golangci/golangci-lint v1.54.2/go.mod h1:vnsaCTPKCI2wreL9tv7RkHDwUrz3htLjed6+6UsvcwU= +github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e h1:ULcKCDV1LOZPFxGZaA6TlQbiM3J2GCPnkx/bGF6sX/g= +github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e/go.mod h1:Pm5KhLPA8gSnQwrQ6ukebRcapGb/BG9iUkdaiCcGHJM= +github.com/golangci/golangci-lint v1.55.0 h1:ePpc6YhM1ZV8kHU8dwmHDHAdeedZHdK8cmTXlkkRdi8= +github.com/golangci/golangci-lint v1.55.0/go.mod h1:Z/OawFQ4yqFo2/plDYlIjoZlJeVYkRcqS9dW55p0FXg= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= github.com/golangci/misspell v0.4.1 h1:+y73iSicVy2PqyX7kmUefHusENlrP9YwuHZHPLGQj/g= github.com/golangci/misspell v0.4.1/go.mod h1:9mAN1quEo3DlpbaIKKyEvRxK1pwqR9s/Sea1bJCtlNI= -github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 h1:DIPQnGy2Gv2FSA4B/hh8Q7xx3B7AIDk3DAMeHclH1vQ= -github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6/go.mod h1:0AKcRCkMoKvUvlf89F6O7H2LYdhr1zBh736mBItOdRs= +github.com/golangci/revgrep v0.5.0 h1:GGBqHFtFOeHiSUQtFVZXPJtVZYOGB4iVlAjaoFRBQvY= +github.com/golangci/revgrep v0.5.0/go.mod h1:bjAMA+Sh/QUfTDcHzxfyHxr4xKvllVr/0sCv2e7jJHA= github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSWhqsYNgcuWO2kFlpdOZbP0+yRjmvPGys= github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -331,8 +343,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jgautheron/goconst v1.5.1 h1:HxVbL1MhydKs8R8n/HE5NPvzfaYmQJA3o879lE4+WcM= -github.com/jgautheron/goconst v1.5.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= +github.com/jgautheron/goconst v1.6.0 h1:gbMLWKRMkzAc6kYsQL6/TxaoBUg3Jm9LSF/Ih1ADWGA= +github.com/jgautheron/goconst v1.6.0/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= @@ -379,6 +391,8 @@ github.com/leonklingele/grouper v1.1.1 h1:suWXRU57D4/Enn6pXR0QVqqWWrnJ9Osrz+5rjt github.com/leonklingele/grouper v1.1.1/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= github.com/lufeee/execinquery v1.2.1 h1:hf0Ems4SHcUGBxpGN7Jz78z1ppVkP/837ZlETPCEtOM= github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= +github.com/macabu/inamedparam v0.1.2 h1:RR5cnayM6Q7cDhQol32DE2BGAPGMnffJ31LFE+UklaU= +github.com/macabu/inamedparam v0.1.2/go.mod h1:Xg25QvY7IBRl1KLPV9Rbml8JOMZtF/iAkNkmV7eQgjw= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s93SLMxb2vI= @@ -400,8 +414,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0j github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mbilski/exhaustivestruct v1.2.0 h1:wCBmUnSYufAHO6J4AVWY6ff+oxWxsVFrwgOdMUQePUo= github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= -github.com/mgechev/revive v1.3.2 h1:Wb8NQKBaALBJ3xrrj4zpwJwqwNA6nDpyJSEQWcCka6U= -github.com/mgechev/revive v1.3.2/go.mod h1:UCLtc7o5vg5aXCwdUTU1kEBQ1v+YXPAkYDIDXbrs5I0= +github.com/mgechev/revive v1.3.4 h1:k/tO3XTaWY4DEHal9tWBkkUMJYO/dLDVyMmAQxmIMDc= +github.com/mgechev/revive v1.3.4/go.mod h1:W+pZCMu9qj8Uhfs1iJMQsEFLRozUfvwFwqVvRbSNLVw= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= @@ -423,16 +437,17 @@ github.com/nishanths/exhaustive v0.11.0 h1:T3I8nUGhl/Cwu5Z2hfc92l0e04D2GEW6e0l8p github.com/nishanths/exhaustive v0.11.0/go.mod h1:RqwDsZ1xY0dNdqHho2z6X+bgzizwbLYOWnZbbl2wLB4= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= -github.com/nunnatsa/ginkgolinter v0.13.5 h1:fOsPB4CEZOPkyMqF4B9hoqOpooFWU7vWSVkCSscVpgU= -github.com/nunnatsa/ginkgolinter v0.13.5/go.mod h1:OBHy4536xtuX3102NM63XRtOyxqZOO02chsaeDWXVO8= +github.com/nunnatsa/ginkgolinter v0.14.0 h1:XQPNmw+kZz5cC/HbFK3mQutpjzAQv1dHregRA+4CGGg= +github.com/nunnatsa/ginkgolinter v0.14.0/go.mod h1:cm2xaqCUCRd7qcP4DqbVvpcyEMkuLM9CF0wY6VASohk= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= -github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= -github.com/otiai10/copy v1.2.0 h1:HvG945u96iNadPoG2/Ja2+AUJeW5YuFQMixq9yirC+k= +github.com/onsi/ginkgo/v2 v2.12.1 h1:uHNEO1RP2SpuZApSkel9nEh1/Mu+hmQe7Q+Pepg5OYA= +github.com/onsi/ginkgo/v2 v2.12.1/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= +github.com/onsi/gomega v1.28.0 h1:i2rg/p9n/UqIDAMFUJ6qIUUMcsqOuUHgbpbu235Vr1c= +github.com/onsi/gomega v1.28.0/go.mod h1:A1H2JE76sI14WIP57LMKj7FVfCHx3g3BcZVjJG8bjX8= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= +github.com/otiai10/copy v1.11.0 h1:OKBD80J/mLBrwnzXqGtFCzprFSGioo30JcmR4APsNwc= +github.com/otiai10/copy v1.11.0/go.mod h1:rSaLseMUsZFFbsFGc7wCJnnkTAvdc5L6VWxPE4308Ww= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= @@ -447,8 +462,8 @@ github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qR github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/polyfloyd/go-errorlint v1.4.4 h1:A9gytp+p6TYqeALTYRoxJESYP8wJRETRX2xzGWFsEBU= -github.com/polyfloyd/go-errorlint v1.4.4/go.mod h1:ry5NqF7l9Q77V+XqAfUg1zfryrEtyac3G5+WVpIK0xU= +github.com/polyfloyd/go-errorlint v1.4.5 h1:70YWmMy4FgRHehGNOUask3HtSFSOLKgmDn7ryNe7LqI= +github.com/polyfloyd/go-errorlint v1.4.5/go.mod h1:sIZEbFoDOCnTYYZoVkjc4hTnM459tuWA9H/EkdXwsKk= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= @@ -487,8 +502,8 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryancurrah/gomodguard v1.3.0 h1:q15RT/pd6UggBXVBuLps8BXRvl5GPBcwVA7BJHMLuTw= github.com/ryancurrah/gomodguard v1.3.0/go.mod h1:ggBxb3luypPEzqVtq33ee7YSN35V28XeGnid8dnni50= -github.com/ryanrolds/sqlclosecheck v0.4.0 h1:i8SX60Rppc1wRuyQjMciLqIzV3xnoHB7/tXbr6RGYNI= -github.com/ryanrolds/sqlclosecheck v0.4.0/go.mod h1:TBRRjzL31JONc9i4XMinicuo+s+E8yKZ5FN8X3G6CKQ= +github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU= +github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDjY7ZgUR4J8HOO/XQ= github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ= github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= @@ -499,8 +514,8 @@ github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tM github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= github.com/sashamelentyev/usestdlibvars v1.24.0 h1:MKNzmXtGh5N0y74Z/CIaJh4GlB364l0K1RUT08WSWAc= github.com/sashamelentyev/usestdlibvars v1.24.0/go.mod h1:9cYkq+gYJ+a5W2RPdhfaSCnTVUC1OQP/bSiiBhq3OZE= -github.com/securego/gosec/v2 v2.17.0 h1:ZpAStTDKY39insEG9OH6kV3IkhQZPTq9a9eGOLOjcdI= -github.com/securego/gosec/v2 v2.17.0/go.mod h1:lt+mgC91VSmriVoJLentrMkRCYs+HLTBnUFUBuhV2hc= +github.com/securego/gosec/v2 v2.18.1 h1:xnnehWg7dIW8qrRPGm8ykY21zp2MueKyC99Vlcuj96I= +github.com/securego/gosec/v2 v2.18.1/go.mod h1:ZUTcKD9gAFip1lLGHWCjkoBQJyaEzePTNzjwlL2HHoE= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= @@ -550,7 +565,6 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.2/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/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= @@ -563,8 +577,8 @@ github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= -github.com/tetafro/godot v1.4.14 h1:ScO641OHpf9UpHPk8fCknSuXNMpi4iFlwuWoBs3L+1s= -github.com/tetafro/godot v1.4.14/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= +github.com/tetafro/godot v1.4.15 h1:QzdIs+XB8q+U1WmQEWKHQbKmCw06QuQM7gLx/dky2RM= +github.com/tetafro/godot v1.4.15/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 h1:quvGphlmUVU+nhpFa4gg4yJyTRJ13reZMDHrKwYw53M= github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ= github.com/timonwong/loggercheck v0.9.4 h1:HKKhqrjcVj8sxL7K77beXh0adEm6DLjV/QOGeMXEVi4= @@ -581,10 +595,10 @@ github.com/ultraware/funlen v0.1.0 h1:BuqclbkY6pO+cvxoq7OsktIXZpgBSkYTQtmwhAK81v github.com/ultraware/funlen v0.1.0/go.mod h1:XJqmOQja6DpxarLj6Jj1U7JuoS8PvL4nEqDaQhy22p4= github.com/ultraware/whitespace v0.0.5 h1:hh+/cpIcopyMYbZNVov9iSxvJU3OYQg78Sfaqzi/CzI= github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= -github.com/uudashr/gocognit v1.0.7 h1:e9aFXgKgUJrQ5+bs61zBigmj7bFJ/5cC6HmMahVzuDo= -github.com/uudashr/gocognit v1.0.7/go.mod h1:nAIUuVBnYU7pcninia3BHOvQkpQCeO76Uscky5BOwcY= -github.com/xen0n/gosmopolitan v1.2.1 h1:3pttnTuFumELBRSh+KQs1zcz4fN6Zy7aB0xlnQSn1Iw= -github.com/xen0n/gosmopolitan v1.2.1/go.mod h1:JsHq/Brs1o050OOdmzHeOr0N7OtlnKRAGAsElF8xBQA= +github.com/uudashr/gocognit v1.1.2 h1:l6BAEKJqQH2UpKAPKdMfZf5kE4W/2xk8pfU1OVLvniI= +github.com/uudashr/gocognit v1.1.2/go.mod h1:aAVdLURqcanke8h3vg35BC++eseDm66Z7KmchI5et4k= +github.com/xen0n/gosmopolitan v1.2.2 h1:/p2KTnMzwRexIW8GlKawsTWOxn7UHA+jCMF/V8HHtvU= +github.com/xen0n/gosmopolitan v1.2.2/go.mod h1:7XX7Mj61uLYrj0qmeN0zi7XDon9JRAEhYQqAPLVNTeg= github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= github.com/yeya24/promlinter v0.2.0 h1:xFKDQ82orCU5jQujdaD8stOHiv8UN68BSdn2a8u8Y3o= @@ -598,10 +612,12 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -gitlab.com/bosi/decorder v0.4.0 h1:HWuxAhSxIvsITcXeP+iIRg9d1cVfvVkmlF7M68GaoDY= -gitlab.com/bosi/decorder v0.4.0/go.mod h1:xarnteyUoJiOTEldDysquWKTVDCKo2TOIOIibSuWqOg= +gitlab.com/bosi/decorder v0.4.1 h1:VdsdfxhstabyhZovHafFw+9eJ6eU0d2CkFNJcZz/NU4= +gitlab.com/bosi/decorder v0.4.1/go.mod h1:jecSqWUew6Yle1pCr2eLWTensJMmsxHsBwt+PVbkAqA= go-simpler.org/assert v0.6.0 h1:QxSrXa4oRuo/1eHMXSBFHKvJIpWABayzKldqZyugG7E= go-simpler.org/assert v0.6.0/go.mod h1:74Eqh5eI6vCK6Y5l3PI8ZYFXG4Sa+tkr70OIPJAUr28= +go-simpler.org/sloglint v0.1.2 h1:IjdhF8NPxyn0Ckn2+fuIof7ntSnVUAqBFcQRrnG9AiM= +go-simpler.org/sloglint v0.1.2/go.mod h1:2LL+QImPfTslD5muNPydAEYmpXIj6o/WYcqnJjLi4o4= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -674,8 +690,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= +golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -718,8 +734,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -743,8 +759,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -895,8 +911,8 @@ golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/vuln v1.0.1 h1:KUas02EjQK5LTuIx1OylBQdKKZ9jeugs+HiqO5HormU= golang.org/x/vuln v1.0.1/go.mod h1:bb2hMwln/tqxg32BNY4CcxHWtHXuYa3SbIBmtsyjxtM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1027,8 +1043,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.4.5 h1:YGD4H+SuIOOqsyoLOpZDWcieM28W47/zRO7f+9V3nvo= -honnef.co/go/tools v0.4.5/go.mod h1:GUV+uIBCLpdf0/v6UhHHG/yzI/z6qPskBeQCjcNB96k= +honnef.co/go/tools v0.4.6 h1:oFEHCKeID7to/3autwsWfnuv69j3NsfcXbvJKuIcep8= +honnef.co/go/tools v0.4.6/go.mod h1:+rnGS1THNh8zMwnd2oVOTL9QF6vmfyG6ZXBULae2uc0= mvdan.cc/gofumpt v0.5.0 h1:0EQ+Z56k8tXjj/6TQD25BFNKQXpCvT0rnansIc7Ug5E= mvdan.cc/gofumpt v0.5.0/go.mod h1:HBeVDtMKRZpXyxFciAirzdKklDlGu8aAy1wEbH5Y9js= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= From 95f48b2c82b7f57ecae1f0f74bc43b22d4001ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Tue, 24 Oct 2023 16:41:49 +0200 Subject: [PATCH 2/8] Fix new golangci-lint warnings --- storeapi/go-wrapper/microsoftstore/store_windows.go | 1 + wsl-pro-service/internal/testutils/mock_executables.go | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/storeapi/go-wrapper/microsoftstore/store_windows.go b/storeapi/go-wrapper/microsoftstore/store_windows.go index 7d98388e1..9ce3b40a5 100644 --- a/storeapi/go-wrapper/microsoftstore/store_windows.go +++ b/storeapi/go-wrapper/microsoftstore/store_windows.go @@ -54,6 +54,7 @@ func GenerateUserJWT(azureADToken string) (jwt string, err error) { //nolint:gosec // This is the way of freeing userJWTbegin per storeapi's API definition defer windows.CoTaskMemFree(unsafe.Pointer(userJWTbegin)) + //nolint:gosec // This is the way of converting a Win32 string to a Go string return string(unsafe.Slice(userJWTbegin, userJWTlen)), nil } diff --git a/wsl-pro-service/internal/testutils/mock_executables.go b/wsl-pro-service/internal/testutils/mock_executables.go index bbbbd03db..755a863f2 100644 --- a/wsl-pro-service/internal/testutils/mock_executables.go +++ b/wsl-pro-service/internal/testutils/mock_executables.go @@ -64,8 +64,6 @@ type controlArg string // Arguments that control how the mocked executable will behave. // If none are provided, the mock will copy the behaviour of the real thing. -// -//nolint:gosec // None of these are credentials const ( ProStatusErr = "UP4W_PRO_STATUS_ERR" ProStatusBadJSON = "UP4W_PRO_STATUS_BAD_JSON" From b76eaca5cc5c32e4130c26a631567b1e6dff6c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Tue, 24 Oct 2023 16:45:13 +0200 Subject: [PATCH 3/8] Enable testifylint linter --- .golangci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.golangci.yaml b/.golangci.yaml index a10355552..659a18f88 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -27,6 +27,7 @@ linters: - unparam - usestdlibvars - whitespace + - testifylint run: timeout: 5m From 73e05c14b5f5e1ad2c5040b5ab421a5dd90a9d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Tue, 24 Oct 2023 16:57:05 +0200 Subject: [PATCH 4/8] Fix issues raised by testifylint --- tools/generate/internal/generators/common_test.go | 4 ++-- windows-agent/cmd/ubuntu-pro-agent/main_linux_test.go | 2 +- windows-agent/internal/distros/database/database_test.go | 4 ++-- windows-agent/internal/grpc/logstreamer/client_test.go | 2 +- windows-agent/internal/grpc/logstreamer/server_test.go | 6 +++--- wsl-pro-service/cmd/wsl-pro-service/main_test.go | 2 +- wsl-pro-service/internal/grpc/logstreamer/client_test.go | 2 +- wsl-pro-service/internal/grpc/logstreamer/server_test.go | 6 +++--- wsl-pro-service/internal/system/system_test.go | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tools/generate/internal/generators/common_test.go b/tools/generate/internal/generators/common_test.go index 48d275fb1..0d95ee3af 100644 --- a/tools/generate/internal/generators/common_test.go +++ b/tools/generate/internal/generators/common_test.go @@ -22,7 +22,7 @@ func TestCleanDirectory(t *testing.T) { content, err := os.ReadDir(d) require.NoError(t, err, "New cleaned directory should exists") - require.Equal(t, 0, len(content), "Directory should be empty") + require.Empty(t, content, "Directory should be empty") } func TestCleanDirectoryNoDirectoryExists(t *testing.T) { @@ -38,7 +38,7 @@ func TestCleanDirectoryNoDirectoryExists(t *testing.T) { content, err := os.ReadDir(d) require.NoError(t, err, "New cleaned directory should exists") - require.Equal(t, 0, len(content), "Directory should be empty") + require.Empty(t, content, "Directory should be empty") } func TestCleanDirectoryCantRemoveDirectory(t *testing.T) { diff --git a/windows-agent/cmd/ubuntu-pro-agent/main_linux_test.go b/windows-agent/cmd/ubuntu-pro-agent/main_linux_test.go index b5a65ff6b..12c7f8ed9 100644 --- a/windows-agent/cmd/ubuntu-pro-agent/main_linux_test.go +++ b/windows-agent/cmd/ubuntu-pro-agent/main_linux_test.go @@ -52,7 +52,7 @@ func TestRunSignal(t *testing.T) { case <-wait: exited = true } - require.Equal(t, true, exited, "Expect to exit on SIGINT and SIGTERM") + require.True(t, exited, "Expect to exit on SIGINT and SIGTERM") } if !exited { diff --git a/windows-agent/internal/distros/database/database_test.go b/windows-agent/internal/distros/database/database_test.go index be6b8df02..03228b38b 100644 --- a/windows-agent/internal/distros/database/database_test.go +++ b/windows-agent/internal/distros/database/database_test.go @@ -292,9 +292,9 @@ func TestDatabaseDump(t *testing.T) { sd := newStructuredDump(t, dump) if tc.emptyDB { - require.Empty(t, len(sd.data), "Database dump should contain no distros") + require.Empty(t, sd.data, "Database dump should contain no distros") } else { - require.Equal(t, 2, len(sd.data), "Database dump should contain exactly two distros") + require.Len(t, sd.data, 2, "Database dump should contain exactly two distros") idx1 := slices.IndexFunc(sd.data, func(s database.SerializableDistro) bool { return s.Name == distro1 }) idx2 := slices.IndexFunc(sd.data, func(s database.SerializableDistro) bool { return s.Name == distro2 }) diff --git a/windows-agent/internal/grpc/logstreamer/client_test.go b/windows-agent/internal/grpc/logstreamer/client_test.go index 5782b7704..5976b2f7e 100644 --- a/windows-agent/internal/grpc/logstreamer/client_test.go +++ b/windows-agent/internal/grpc/logstreamer/client_test.go @@ -161,7 +161,7 @@ func TestRecvLogMsg(t *testing.T) { } if tc.wantErr { - // assert and not require as we want to check logs still + //nolint:testifylint // assert and not require as we want to check logs still assert.Error(t, err, "RecvMsg should have errored out but did not") if tc.errRecv != nil { assert.Equal(t, err, tc.errRecv, "error from errRecv is directly sent back to client") diff --git a/windows-agent/internal/grpc/logstreamer/server_test.go b/windows-agent/internal/grpc/logstreamer/server_test.go index 2db197992..e347fdf20 100644 --- a/windows-agent/internal/grpc/logstreamer/server_test.go +++ b/windows-agent/internal/grpc/logstreamer/server_test.go @@ -61,7 +61,7 @@ func TestStreamServerInterceptor(t *testing.T) { assert.Equal(t, 1, handlerCalled, "handler was expected to be called once") - assert.Equal(t, 1, len(stream.msgs), "Send id as log to client") + assert.Len(t, stream.msgs, 1, "Send id as log to client") msgContains(t, "Connecting as [[123456:", stream.msgs[0], "Send id string to client") } @@ -88,7 +88,7 @@ func TestStreamServerInterceptorSendLogsFails(t *testing.T) { assert.Equal(t, 1, handlerCalled, "handler was expected to be called once") - assert.Equal(t, 0, len(stream.msgs), "Send to client did not succeed") + assert.Empty(t, stream.msgs, "Send to client did not succeed") } func TestStreamServerInterceptorLoggerInvalidMetadata(t *testing.T) { @@ -144,8 +144,8 @@ func TestStreamServerInterceptorLoggerInvalidMetadata(t *testing.T) { s := struct{}{} logger := logrus.New() err := log.StreamServerInterceptor(logger)(s, &stream, nil, handler) - assert.Error(t, err, "StreamServerInterceptor should return an error when no expected metadata are there") assert.Equal(t, 0, handlerCalled, "handler should not be called when in error") + require.Error(t, err, "StreamServerInterceptor should return an error when no expected metadata are there") }) } } diff --git a/wsl-pro-service/cmd/wsl-pro-service/main_test.go b/wsl-pro-service/cmd/wsl-pro-service/main_test.go index 9dd8034c3..04ff29a29 100644 --- a/wsl-pro-service/cmd/wsl-pro-service/main_test.go +++ b/wsl-pro-service/cmd/wsl-pro-service/main_test.go @@ -50,7 +50,7 @@ func TestRunSignal(t *testing.T) { case <-wait: exited = true } - require.Equal(t, true, exited, "Expect to exit on SIGINT and SIGTERM") + require.True(t, exited, "Expect to exit on SIGINT and SIGTERM") } if !exited { diff --git a/wsl-pro-service/internal/grpc/logstreamer/client_test.go b/wsl-pro-service/internal/grpc/logstreamer/client_test.go index 5109b22e1..3a74a9f54 100644 --- a/wsl-pro-service/internal/grpc/logstreamer/client_test.go +++ b/wsl-pro-service/internal/grpc/logstreamer/client_test.go @@ -161,7 +161,7 @@ func TestRecvLogMsg(t *testing.T) { } if tc.wantErr { - // assert and not require as we want to check logs still + //nolint:testifylint // assert and not require as we want to check logs still assert.Error(t, err, "RecvMsg should have errored out but did not") if tc.errRecv != nil { assert.Equal(t, err, tc.errRecv, "error from errRecv is directly sent back to client") diff --git a/wsl-pro-service/internal/grpc/logstreamer/server_test.go b/wsl-pro-service/internal/grpc/logstreamer/server_test.go index 7bfc5c851..01c7b763b 100644 --- a/wsl-pro-service/internal/grpc/logstreamer/server_test.go +++ b/wsl-pro-service/internal/grpc/logstreamer/server_test.go @@ -61,7 +61,7 @@ func TestStreamServerInterceptor(t *testing.T) { assert.Equal(t, 1, handlerCalled, "handler was expected to be called once") - assert.Equal(t, 1, len(stream.msgs), "Send id as log to client") + assert.Len(t, stream.msgs, 1, "Send id as log to client") msgContains(t, "Connecting as [[123456:", stream.msgs[0], "Send id string to client") } @@ -88,7 +88,7 @@ func TestStreamServerInterceptorSendLogsFails(t *testing.T) { assert.Equal(t, 1, handlerCalled, "handler was expected to be called once") - assert.Equal(t, 0, len(stream.msgs), "Send to client did not succeed") + assert.Empty(t, stream.msgs, "Send to client did not succeed") } func TestStreamServerInterceptorLoggerInvalidMetadata(t *testing.T) { @@ -144,8 +144,8 @@ func TestStreamServerInterceptorLoggerInvalidMetadata(t *testing.T) { s := struct{}{} logger := logrus.New() err := log.StreamServerInterceptor(logger)(s, &stream, nil, handler) - assert.Error(t, err, "StreamServerInterceptor should return an error when no expected metadata are there") assert.Equal(t, 0, handlerCalled, "handler should not be called when in error") + require.Error(t, err, "StreamServerInterceptor should return an error when no expected metadata are there") }) } } diff --git a/wsl-pro-service/internal/system/system_test.go b/wsl-pro-service/internal/system/system_test.go index b9baf9c0f..dcec44295 100644 --- a/wsl-pro-service/internal/system/system_test.go +++ b/wsl-pro-service/internal/system/system_test.go @@ -115,7 +115,7 @@ func TestInfo(t *testing.T) { assert.Equal(t, "22.04", info.VersionId, "VersionId does not match expected value") assert.Equal(t, "Ubuntu 22.04.1 LTS", info.PrettyName, "PrettyName does not match expected value") assert.Equal(t, "TEST_DISTRO_HOSTNAME", info.Hostname, "Hostname does not match expected value") - assert.Equal(t, true, info.ProAttached, "ProAttached does not match expected value") + assert.True(t, info.ProAttached, "ProAttached does not match expected value") }) } } From cf1347dbf69174d1bba4141a3582dd2befc70799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Tue, 24 Oct 2023 17:01:13 +0200 Subject: [PATCH 5/8] Enable protogetter linter --- .golangci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.golangci.yaml b/.golangci.yaml index 659a18f88..ef2a028a1 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -20,14 +20,15 @@ linters: - misspell - nakedret - nolintlint + - protogetter - revive + - testifylint - thelper - tparallel - unconvert - unparam - usestdlibvars - whitespace - - testifylint run: timeout: 5m From 882df111abc7df3d6cfda8d85843675bddca9bd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Tue, 24 Oct 2023 17:01:52 +0200 Subject: [PATCH 6/8] Fix issues raised by protogetter --- .../landscape_mock_service.go | 18 +++++----- .../internal/grpc/logstreamer/client.go | 6 ++-- .../internal/grpc/logstreamer/server_test.go | 8 ++--- .../proservices/landscape/receive_commands.go | 34 +++++++++---------- windows-agent/internal/proservices/ui/ui.go | 2 +- .../internal/proservices/ui/ui_test.go | 8 ++--- .../proservices/wslinstance/wslinstance.go | 22 ++++++------ wsl-pro-service/internal/daemon/daemon.go | 4 +-- .../internal/grpc/logstreamer/client.go | 6 ++-- .../internal/grpc/logstreamer/server_test.go | 8 ++--- .../internal/system/system_test.go | 12 +++---- .../wslinstanceservice/wslinstanceservice.go | 8 ++--- 12 files changed, 68 insertions(+), 68 deletions(-) diff --git a/mocks/landscape/landscapemockservice/landscape_mock_service.go b/mocks/landscape/landscapemockservice/landscape_mock_service.go index b02bd35e7..f1a07a4ad 100644 --- a/mocks/landscape/landscapemockservice/landscape_mock_service.go +++ b/mocks/landscape/landscapemockservice/landscape_mock_service.go @@ -32,18 +32,18 @@ type HostInfo struct { // newHostInfo recursively copies the info in a landscapeapi.HostAgentInfo to a HostInfo. func newHostInfo(src *landscapeapi.HostAgentInfo) HostInfo { h := HostInfo{ - UID: src.Uid, - Hostname: src.Hostname, - Token: src.Token, - Instances: make([]InstanceInfo, 0, len(src.Instances)), + UID: src.GetUid(), + Hostname: src.GetHostname(), + Token: src.GetToken(), + Instances: make([]InstanceInfo, 0, len(src.GetInstances())), } - for _, inst := range src.Instances { + for _, inst := range src.GetInstances() { h.Instances = append(h.Instances, InstanceInfo{ - ID: inst.Id, - Name: inst.Name, - VersionID: inst.VersionId, - InstanceState: inst.InstanceState, + ID: inst.GetId(), + Name: inst.GetName(), + VersionID: inst.GetVersionId(), + InstanceState: inst.GetInstanceState(), }) } diff --git a/windows-agent/internal/grpc/logstreamer/client.go b/windows-agent/internal/grpc/logstreamer/client.go index 86e4b9581..85788cfd5 100644 --- a/windows-agent/internal/grpc/logstreamer/client.go +++ b/windows-agent/internal/grpc/logstreamer/client.go @@ -63,10 +63,10 @@ func (ss *logClientStream) RecvMsg(m interface{}) error { if err = proto.Unmarshal(bytes, &logMsg); err != nil { Warning(context.Background(), err) } - if logMsg.LogHeader == logIdentifier { - level, err := logrus.ParseLevel(logMsg.Level) + if logMsg.GetLogHeader() == logIdentifier { + level, err := logrus.ParseLevel(logMsg.GetLevel()) if err != nil { - return fmt.Errorf("client received an invalid debug log level: %s", logMsg.Level) + return fmt.Errorf("client received an invalid debug log level: %s", logMsg.GetLevel()) } localLoggerMu.Lock() diff --git a/windows-agent/internal/grpc/logstreamer/server_test.go b/windows-agent/internal/grpc/logstreamer/server_test.go index e347fdf20..27a91b600 100644 --- a/windows-agent/internal/grpc/logstreamer/server_test.go +++ b/windows-agent/internal/grpc/logstreamer/server_test.go @@ -163,7 +163,7 @@ func msgContains(t *testing.T, expected string, msg interface{}, description str if !ok { t.Fatalf("Expected a log, but send: %+v", msg) } - assert.Contains(t, l.Msg, expected, description) + assert.Contains(t, l.GetMsg(), expected, description) } func createLogStream(t *testing.T, level logrus.Level, callerForLocal, callerForRemote bool, sendError error) (stream grpc.ServerStream, localLogs func() string, remoteLogs func() string) { @@ -193,9 +193,9 @@ func createLogStream(t *testing.T, level logrus.Level, callerForLocal, callerFor if !ok { t.Fatalf("Expected a log, but send: %+v", m) } - msg := fmt.Sprintf("level=%s msg=%s", l.Level, l.Msg) - if l.Caller != "" { - msg = fmt.Sprintf("%s HASCALLER: %s", msg, l.Caller) + msg := fmt.Sprintf("level=%s msg=%s", l.GetLevel(), l.GetMsg()) + if l.GetCaller() != "" { + msg = fmt.Sprintf("%s HASCALLER: %s", msg, l.GetCaller()) } out = append(out, msg) } diff --git a/windows-agent/internal/proservices/landscape/receive_commands.go b/windows-agent/internal/proservices/landscape/receive_commands.go index 142a58df2..45ed352aa 100644 --- a/windows-agent/internal/proservices/landscape/receive_commands.go +++ b/windows-agent/internal/proservices/landscape/receive_commands.go @@ -39,7 +39,7 @@ func (c *Client) receiveCommands(conn *connection) error { func (c *Client) exec(ctx context.Context, command *landscapeapi.Command) (err error) { defer decorate.OnError(&err, "could not execute command %s", commandString(command)) - switch cmd := command.Cmd.(type) { + switch cmd := command.GetCmd().(type) { case *landscapeapi.Command_AssignHost_: return c.cmdAssignHost(ctx, cmd.AssignHost) case *landscapeapi.Command_Start_: @@ -55,24 +55,24 @@ func (c *Client) exec(ctx context.Context, command *landscapeapi.Command) (err e case *landscapeapi.Command_ShutdownHost_: return c.cmdShutdownHost(ctx, cmd.ShutdownHost) default: - return fmt.Errorf("unknown command type %T: %v", command.Cmd, command.Cmd) + return fmt.Errorf("unknown command type %T: %v", command.GetCmd(), command.GetCmd()) } } func commandString(command *landscapeapi.Command) string { - switch cmd := command.Cmd.(type) { + switch cmd := command.GetCmd().(type) { case *landscapeapi.Command_AssignHost_: - return fmt.Sprintf("Assign host (uid: %q)", cmd.AssignHost.Uid) + return fmt.Sprintf("Assign host (uid: %q)", cmd.AssignHost.GetUid()) case *landscapeapi.Command_Start_: - return fmt.Sprintf("Start (id: %q)", cmd.Start.Id) + return fmt.Sprintf("Start (id: %q)", cmd.Start.GetId()) case *landscapeapi.Command_Stop_: - return fmt.Sprintf("Stop (id: %q)", cmd.Stop.Id) + return fmt.Sprintf("Stop (id: %q)", cmd.Stop.GetId()) case *landscapeapi.Command_Install_: - return fmt.Sprintf("Install (id: %q)", cmd.Install.Id) + return fmt.Sprintf("Install (id: %q)", cmd.Install.GetId()) case *landscapeapi.Command_Uninstall_: - return fmt.Sprintf("Uninstall (id: %q)", cmd.Uninstall.Id) + return fmt.Sprintf("Uninstall (id: %q)", cmd.Uninstall.GetId()) case *landscapeapi.Command_SetDefault_: - return fmt.Sprintf("SetDefault (id: %q)", cmd.SetDefault.Id) + return fmt.Sprintf("SetDefault (id: %q)", cmd.SetDefault.GetId()) case *landscapeapi.Command_ShutdownHost_: return "ShutdownHost" default: @@ -85,7 +85,7 @@ func (c *Client) cmdAssignHost(ctx context.Context, cmd *landscapeapi.Command_As log.Warning(ctx, "Overriding current landscape client UID") } - c.setUID(cmd.Uid) + c.setUID(cmd.GetUid()) if err := c.dump(); err != nil { return err @@ -96,9 +96,9 @@ func (c *Client) cmdAssignHost(ctx context.Context, cmd *landscapeapi.Command_As //nolint:unparam // ctx is not necessary but is here to be consistent with the other commands. func (c *Client) cmdStart(ctx context.Context, cmd *landscapeapi.Command_Start) (err error) { - d, ok := c.db.Get(cmd.Id) + d, ok := c.db.Get(cmd.GetId()) if !ok { - return fmt.Errorf("distro %q not in database", cmd.Id) + return fmt.Errorf("distro %q not in database", cmd.GetId()) } return d.LockAwake() @@ -106,16 +106,16 @@ func (c *Client) cmdStart(ctx context.Context, cmd *landscapeapi.Command_Start) //nolint:unparam // ctx is not necessary but is here to be consistent with the other commands. func (c *Client) cmdStop(ctx context.Context, cmd *landscapeapi.Command_Stop) (err error) { - d, ok := c.db.Get(cmd.Id) + d, ok := c.db.Get(cmd.GetId()) if !ok { - return fmt.Errorf("distro %q not in database", cmd.Id) + return fmt.Errorf("distro %q not in database", cmd.GetId()) } return d.ReleaseAwake() } func (*Client) cmdInstall(ctx context.Context, cmd *landscapeapi.Command_Install) (err error) { - if cmd.Cloudinit != nil && *cmd.Cloudinit != "" { + if cmd.GetCloudinit() != "" { return fmt.Errorf("Cloud Init support is not yet available") } @@ -169,9 +169,9 @@ func (*Client) cmdInstall(ctx context.Context, cmd *landscapeapi.Command_Install } func (c *Client) cmdUninstall(ctx context.Context, cmd *landscapeapi.Command_Uninstall) (err error) { - d, ok := c.db.Get(cmd.Id) + d, ok := c.db.Get(cmd.GetId()) if !ok { - return fmt.Errorf("distro %q not in database", cmd.Id) + return fmt.Errorf("distro %q not in database", cmd.GetId()) } return d.Uninstall(ctx) diff --git a/windows-agent/internal/proservices/ui/ui.go b/windows-agent/internal/proservices/ui/ui.go index 505225de1..a1a92f9fd 100644 --- a/windows-agent/internal/proservices/ui/ui.go +++ b/windows-agent/internal/proservices/ui/ui.go @@ -42,7 +42,7 @@ func New(ctx context.Context, config Config, db *database.DistroDB) (s Service) // ApplyProToken handles the gRPC call to pro attach all distros using a token provided by the GUI. func (s *Service) ApplyProToken(ctx context.Context, info *agentapi.ProAttachInfo) (*agentapi.Empty, error) { - token := info.Token + token := info.GetToken() log.Debugf(ctx, "Received token %s", common.Obfuscate(token)) err := s.config.SetSubscription(ctx, token, config.SubscriptionUser) diff --git a/windows-agent/internal/proservices/ui/ui_test.go b/windows-agent/internal/proservices/ui/ui_test.go index a7c04d507..e4209ddf8 100644 --- a/windows-agent/internal/proservices/ui/ui_test.go +++ b/windows-agent/internal/proservices/ui/ui_test.go @@ -155,8 +155,8 @@ func TestGetSubscriptionInfo(t *testing.T) { } require.NoError(t, err, "GetSubscriptionInfo should return no errors") - require.IsType(t, tc.wantType, info.SubscriptionType, "Mismatched subscription types") - require.Equal(t, tc.wantImmutable, info.Immutable, "Mismatched value for ReadOnly") + require.IsType(t, tc.wantType, info.GetSubscriptionType(), "Mismatched subscription types") + require.Equal(t, tc.wantImmutable, info.GetImmutable(), "Mismatched value for ReadOnly") }) } } @@ -199,8 +199,8 @@ func TestNotifyPurchase(t *testing.T) { } require.NoError(t, err, "NotifyPurchase should return no errors") - require.IsType(t, tc.wantType, info.SubscriptionType, "Mismatched subscription types") - require.Equal(t, tc.wantImmutable, info.Immutable, "Mismatched value for ReadOnly") + require.IsType(t, tc.wantType, info.GetSubscriptionType(), "Mismatched subscription types") + require.Equal(t, tc.wantImmutable, info.GetImmutable(), "Mismatched value for ReadOnly") }) } } diff --git a/windows-agent/internal/proservices/wslinstance/wslinstance.go b/windows-agent/internal/proservices/wslinstance/wslinstance.go index 30c2402f2..48a221980 100644 --- a/windows-agent/internal/proservices/wslinstance/wslinstance.go +++ b/windows-agent/internal/proservices/wslinstance/wslinstance.go @@ -56,14 +56,14 @@ func (s *Service) Connected(stream agentapi.WSLInstance_ConnectedServer) error { props, err := propsFromInfo(info) if err != nil { - return fmt.Errorf("connection from %q: invalid DistroInfo: %v", info.WslName, err) + return fmt.Errorf("connection from %q: invalid DistroInfo: %v", info.GetWslName(), err) } - log.Debugf(ctx, "Connection from %q: received properties: %v", info.WslName, props) + log.Debugf(ctx, "Connection from %q: received properties: %v", info.GetWslName(), props) - d, err := s.db.GetDistroAndUpdateProperties(ctx, info.WslName, props) + d, err := s.db.GetDistroAndUpdateProperties(ctx, info.GetWslName(), props) if err != nil { - return fmt.Errorf("connection from %q: %v", info.WslName, err) + return fmt.Errorf("connection from %q: %v", info.GetWslName(), err) } // Load deferred tasks @@ -81,7 +81,7 @@ func (s *Service) Connected(stream agentapi.WSLInstance_ConnectedServer) error { } if err := d.SetConnection(conn); err != nil { - return fmt.Errorf("connection from %q: %v", info.WslName, err) + return fmt.Errorf("connection from %q: %v", info.GetWslName(), err) } //nolint:errcheck // We don't care about this error because we're cleaning up @@ -180,16 +180,16 @@ func getPort(lis net.Listener) (uint32, error) { func propsFromInfo(info *agentapi.DistroInfo) (props distro.Properties, err error) { defer decorate.OnError(&err, "received invalid distribution info") - if info.WslName == "" { + if info.GetWslName() == "" { return props, errors.New("no id provided") } return distro.Properties{ - DistroID: info.Id, - VersionID: info.VersionId, - PrettyName: info.PrettyName, - ProAttached: info.ProAttached, - Hostname: info.Hostname, + DistroID: info.GetId(), + VersionID: info.GetVersionId(), + PrettyName: info.GetPrettyName(), + ProAttached: info.GetProAttached(), + Hostname: info.GetHostname(), }, nil } diff --git a/wsl-pro-service/internal/daemon/daemon.go b/wsl-pro-service/internal/daemon/daemon.go index 115d3b6c5..4a25c74bd 100644 --- a/wsl-pro-service/internal/daemon/daemon.go +++ b/wsl-pro-service/internal/daemon/daemon.go @@ -215,9 +215,9 @@ func getAddressToListenTo(ctrlStream agentapi.WSLInstance_ConnectedClient) (addr return "", err } - if msg.Port == 0 { + if msg.GetPort() == 0 { return "", errors.New("could not get address to serve on: received invalid port :0 from server") } - return fmt.Sprintf("localhost:%d", msg.Port), nil + return fmt.Sprintf("localhost:%d", msg.GetPort()), nil } diff --git a/wsl-pro-service/internal/grpc/logstreamer/client.go b/wsl-pro-service/internal/grpc/logstreamer/client.go index c2f7659df..98fb29ba2 100644 --- a/wsl-pro-service/internal/grpc/logstreamer/client.go +++ b/wsl-pro-service/internal/grpc/logstreamer/client.go @@ -63,10 +63,10 @@ func (ss *logClientStream) RecvMsg(m interface{}) error { if err = proto.Unmarshal(bytes, &logMsg); err != nil { Warning(context.Background(), err) } - if logMsg.LogHeader == logIdentifier { - level, err := logrus.ParseLevel(logMsg.Level) + if logMsg.GetLogHeader() == logIdentifier { + level, err := logrus.ParseLevel(logMsg.GetLevel()) if err != nil { - return fmt.Errorf("client received an invalid debug log level: %s", logMsg.Level) + return fmt.Errorf("client received an invalid debug log level: %s", logMsg.GetLevel()) } localLoggerMu.Lock() diff --git a/wsl-pro-service/internal/grpc/logstreamer/server_test.go b/wsl-pro-service/internal/grpc/logstreamer/server_test.go index 01c7b763b..9d0302a0a 100644 --- a/wsl-pro-service/internal/grpc/logstreamer/server_test.go +++ b/wsl-pro-service/internal/grpc/logstreamer/server_test.go @@ -163,7 +163,7 @@ func msgContains(t *testing.T, expected string, msg interface{}, description str if !ok { t.Fatalf("Expected a log, but send: %+v", msg) } - assert.Contains(t, l.Msg, expected, description) + assert.Contains(t, l.GetMsg(), expected, description) } func createLogStream(t *testing.T, level logrus.Level, callerForLocal, callerForRemote bool, sendError error) (stream grpc.ServerStream, localLogs func() string, remoteLogs func() string) { @@ -193,9 +193,9 @@ func createLogStream(t *testing.T, level logrus.Level, callerForLocal, callerFor if !ok { t.Fatalf("Expected a log, but send: %+v", m) } - msg := fmt.Sprintf("level=%s msg=%s", l.Level, l.Msg) - if l.Caller != "" { - msg = fmt.Sprintf("%s HASCALLER: %s", msg, l.Caller) + msg := fmt.Sprintf("level=%s msg=%s", l.GetLevel(), l.GetMsg()) + if l.GetCaller() != "" { + msg = fmt.Sprintf("%s HASCALLER: %s", msg, l.GetCaller()) } out = append(out, msg) } diff --git a/wsl-pro-service/internal/system/system_test.go b/wsl-pro-service/internal/system/system_test.go index dcec44295..2de3b2cf5 100644 --- a/wsl-pro-service/internal/system/system_test.go +++ b/wsl-pro-service/internal/system/system_test.go @@ -110,12 +110,12 @@ func TestInfo(t *testing.T) { } require.NoError(t, err, "Expected Get() to return no errors") - assert.Equal(t, "TEST_DISTRO", info.WslName, "WslName does not match expected value") - assert.Equal(t, "ubuntu", info.Id, "Id does not match expected value") - assert.Equal(t, "22.04", info.VersionId, "VersionId does not match expected value") - assert.Equal(t, "Ubuntu 22.04.1 LTS", info.PrettyName, "PrettyName does not match expected value") - assert.Equal(t, "TEST_DISTRO_HOSTNAME", info.Hostname, "Hostname does not match expected value") - assert.True(t, info.ProAttached, "ProAttached does not match expected value") + assert.Equal(t, "TEST_DISTRO", info.GetWslName(), "WslName does not match expected value") + assert.Equal(t, "ubuntu", info.GetId(), "Id does not match expected value") + assert.Equal(t, "22.04", info.GetVersionId(), "VersionId does not match expected value") + assert.Equal(t, "Ubuntu 22.04.1 LTS", info.GetPrettyName(), "PrettyName does not match expected value") + assert.Equal(t, "TEST_DISTRO_HOSTNAME", info.GetHostname(), "Hostname does not match expected value") + assert.True(t, info.GetProAttached(), "ProAttached does not match expected value") }) } } diff --git a/wsl-pro-service/internal/wslinstanceservice/wslinstanceservice.go b/wsl-pro-service/internal/wslinstanceservice/wslinstanceservice.go index 73fb5e2bd..123c47068 100644 --- a/wsl-pro-service/internal/wslinstanceservice/wslinstanceservice.go +++ b/wsl-pro-service/internal/wslinstanceservice/wslinstanceservice.go @@ -58,10 +58,10 @@ func (s *Service) ApplyProToken(ctx context.Context, info *wslserviceapi.ProAtta } }() - if info.Token == "" { + if info.GetToken() == "" { log.Info(ctx, "ApplyProToken: Received empty token: detaching") } else { - log.Infof(ctx, "ApplyProToken: Received token %q: attaching", common.Obfuscate(info.Token)) + log.Infof(ctx, "ApplyProToken: Received token %q: attaching", common.Obfuscate(info.GetToken())) } if err := s.system.ProDetach(ctx); err != nil { @@ -69,11 +69,11 @@ func (s *Service) ApplyProToken(ctx context.Context, info *wslserviceapi.ProAtta return nil, err } - if info.Token == "" { + if info.GetToken() == "" { return &wslserviceapi.Empty{}, nil } - if err := s.system.ProAttach(ctx, info.Token); err != nil { + if err := s.system.ProAttach(ctx, info.GetToken()); err != nil { log.Errorf(ctx, "Error in ApplyProToken: attachPro:: %v", err) return nil, err } From 2e3f873149105679f4e32d121335eebf10e1f6cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Tue, 24 Oct 2023 17:03:46 +0200 Subject: [PATCH 7/8] Enable sloglint linter --- .golangci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.golangci.yaml b/.golangci.yaml index ef2a028a1..eaa234a77 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -22,6 +22,7 @@ linters: - nolintlint - protogetter - revive + - sloglint - testifylint - thelper - tparallel From b1ba996bc6485a8bce13547b0d1262848860de23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Tue, 24 Oct 2023 17:05:32 +0200 Subject: [PATCH 8/8] Update workspace .sum --- go.work.sum | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/go.work.sum b/go.work.sum index f2c3c6800..3d934a95e 100644 --- a/go.work.sum +++ b/go.work.sum @@ -631,7 +631,6 @@ golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= @@ -657,7 +656,7 @@ golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQ golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk= golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -702,7 +701,7 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= -golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0=