Repository: googleapis/api-linter
Pull request #544 (2020-05-27 21:04:29)

[chore] Update deprecated behavior.
This commit addresses all deprecations found by `golangci-lint` here:
https://app.circleci.com/pipelines/github/googleapis/api-linter/2100/workflows/7a30e6a1-2750-4461-9604-011b5f10cbc5/jobs/6534/steps

This fixes the issues blocking merge of #529.


Patch:
diff --git a/cmd/api-linter/cli.go b/cmd/api-linter/cli.go
index ff2b2e1..13d4e19 100644
--- a/cmd/api-linter/cli.go
+++ b/cmd/api-linter/cli.go
@@ -23,12 +23,12 @@ import (
 	"strings"
 	"sync"
 
-	"github.com/golang/protobuf/proto"
 	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
 	"github.com/googleapis/api-linter/lint"
 	"github.com/jhump/protoreflect/desc"
 	"github.com/jhump/protoreflect/desc/protoparse"
 	"github.com/spf13/pflag"
+	"google.golang.org/protobuf/proto"
 	"gopkg.in/yaml.v2"
 )
 
diff --git a/go.mod b/go.mod
index a784691..64d69ec 100644
--- a/go.mod
+++ b/go.mod
@@ -4,15 +4,16 @@ go 1.13
 
 require (
 	bitbucket.org/creachadair/stringset v0.0.8
-	github.com/bmatcuk/doublestar v1.2.2
-	github.com/gertd/go-pluralize v0.1.1
-	github.com/golang/protobuf v1.3.5
-	github.com/google/go-cmp v0.4.0
-	github.com/jhump/protoreflect v1.6.0
+	github.com/bmatcuk/doublestar v1.3.0
+	github.com/gertd/go-pluralize v0.1.4
+	github.com/golang/protobuf v1.4.2
+	github.com/google/go-cmp v0.4.1
+	github.com/jhump/protoreflect v1.6.1
 	github.com/lithammer/dedent v1.1.0
 	github.com/olekukonko/tablewriter v0.0.4
 	github.com/spf13/pflag v1.0.5
 	github.com/stoewer/go-strcase v1.2.0
-	google.golang.org/genproto v0.0.0-20200330113809-af700f360a68
-	gopkg.in/yaml.v2 v2.2.8
+	google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece
+	google.golang.org/protobuf v1.24.0
+	gopkg.in/yaml.v2 v2.3.0
 )
diff --git a/go.sum b/go.sum
index 973c5b7..c2e959b 100644
--- a/go.sum
+++ b/go.sum
@@ -2,8 +2,8 @@ bitbucket.org/creachadair/stringset v0.0.8 h1:gQqe4vs8XWgMyijfyKE6K8o4TcyGGrRXe0
 bitbucket.org/creachadair/stringset v0.0.8/go.mod h1:AgthVMyMxC/6FK1KBJ2ALdqkZObGN8hOetgpwXyMn34=
 cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/bmatcuk/doublestar v1.2.2 h1:oC24CykoSAB8zd7XgruHo33E0cHJf/WhQA/7BeXj+x0=
-github.com/bmatcuk/doublestar v1.2.2/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE=
+github.com/bmatcuk/doublestar v1.3.0 h1:1jLE2y0VpSrOn/QR9G4f2RmrCtkM3AuATcWradjHUvM=
+github.com/bmatcuk/doublestar v1.3.0/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE=
 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/creachadair/staticfile v0.1.2/go.mod h1:a3qySzCIXEprDGxk6tSxSI+dBBdLzqeBOMhZ+o2d3pM=
@@ -11,25 +11,30 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
 github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/gertd/go-pluralize v0.1.1 h1:fQhql/WRRwr4TVp+TCw12s2esCacvEVBdkTUUwNqF/Q=
-github.com/gertd/go-pluralize v0.1.1/go.mod h1:t5DfHcumb6m0RqyVJDrDLEzL2AGeaiqUXIcDNwLaeAs=
+github.com/gertd/go-pluralize v0.1.4 h1:whO9tabQ5OSpTFr8oZRrlM3owcuyc6NFJho54kBCQUE=
+github.com/gertd/go-pluralize v0.1.4/go.mod h1:3DkM/CcGP3dn/Gt02QBhRit6Jh9Pt9nSV8HHSu88NuE=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
 github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
 github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
 github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
 github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I=
-github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
-github.com/golang/protobuf v1.3.5 h1:F768QJ1E9tib+q5Sc8MkdJi1RxLTbRcTf8LJV56aRls=
-github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
+github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
+github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
 github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
-github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
+github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
 github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE=
-github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74=
+github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0=
+github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/jhump/protoreflect v1.6.1 h1:4/2yi5LyDPP7nN+Hiird1SAJ6YoxUm13/oxHGRnbPd8=
+github.com/jhump/protoreflect v1.6.1/go.mod h1:RZQ/lnuN+zqeRVpQigTwO6o0AJUkxbnSnpuG7toUTG4=
 github.com/lithammer/dedent v1.1.0 h1:VNzHMVCBNG1j0fh3OrsFRkVUwStdDArbgBWoPAffktY=
 github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc=
 github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54=
@@ -46,53 +51,70 @@ github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
 github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
+github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
 golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
 golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
-golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 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-20190213061140-3a22650c66bd h1:HuTn7WObtcDo9uEEU7rEqL0jYthdXAmZ6PP+meazmaU=
 golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
 golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8=
+golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sys v0.0.0-20180830151530-49385e6e1522 h1:Ve1ORMCxvRmSXBwJK+t3Oy+V2vRW2OetUQBq4rJIkZE=
+golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
 golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
+golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
 google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
-google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0 h1:ZvI3lsq5AIkr7axxmT3tfwFlJVRFLqe6Fp0W03+MJ38=
 google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
 google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
-google.golang.org/genproto v0.0.0-20200330113809-af700f360a68 h1:ay2fio+sR6N1ccqZQgr/bUoo6pwgbxU8imlLkQc9Nlo=
-google.golang.org/genproto v0.0.0-20200330113809-af700f360a68/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/grpc v1.8.0 h1:HN69LlNA/SpyBIRxTfuU0QOntYfdeEeBWlVhRHRCOyw=
+google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
+google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece h1:1YM0uhfumvoDu9sx8+RyWwTI63zoCQvI23IYFRlvte0=
+google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
 google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
-google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8=
 google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
 google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
 google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg=
 google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA=
+google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
-gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
+gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/locations/field_locations.go b/locations/field_locations.go
index d35ee95..540703f 100644
--- a/locations/field_locations.go
+++ b/locations/field_locations.go
@@ -23,7 +23,7 @@ import (
 // FieldResourceReference returns the precise location for a field's
 // resource reference annotation.
 func FieldResourceReference(f *desc.FieldDescriptor) *dpb.SourceCodeInfo_Location {
-	return pathLocation(f, 8, int(apb.E_ResourceReference.Field)) // FieldDescriptor.options == 8
+	return pathLocation(f, 8, int(apb.E_ResourceReference.TypeDescriptor().Number())) // FieldDescriptor.options == 8
 }
 
 // FieldType returns the precise location for a field's type.
diff --git a/locations/message_locations.go b/locations/message_locations.go
index ce8851c..06687a5 100644
--- a/locations/message_locations.go
+++ b/locations/message_locations.go
@@ -23,5 +23,5 @@ import (
 // MessageResource returns the precise location of the `google.api.resource`
 // annotation.
 func MessageResource(m *desc.MessageDescriptor) *dpb.SourceCodeInfo_Location {
-	return pathLocation(m, 7, int(apb.E_Resource.Field)) // MessageDescriptor.options == 7
+	return pathLocation(m, 7, int(apb.E_Resource.TypeDescriptor().Number())) // MessageDescriptor.options == 7
 }
diff --git a/locations/method_locations.go b/locations/method_locations.go
index b5f7bba..116f7f3 100644
--- a/locations/method_locations.go
+++ b/locations/method_locations.go
@@ -34,17 +34,17 @@ func MethodResponseType(m *desc.MethodDescriptor) *dpb.SourceCodeInfo_Location {
 // MethodHTTPRule returns the precise location of the method's `google.api.http`
 // rule, if any.
 func MethodHTTPRule(m *desc.MethodDescriptor) *dpb.SourceCodeInfo_Location {
-	return pathLocation(m, 4, int(apb.E_Http.Field)) // MethodDescriptor.options == 4
+	return pathLocation(m, 4, int(apb.E_Http.TypeDescriptor().Number())) // MethodDescriptor.options == 4
 }
 
 // MethodOperationInfo returns the precise location of the method's
 // `google.longrunning.operation_info` annotation, if any.
 func MethodOperationInfo(m *desc.MethodDescriptor) *dpb.SourceCodeInfo_Location {
-	return pathLocation(m, 4, int(lrpb.E_OperationInfo.Field)) // MethodDescriptor.options == 4
+	return pathLocation(m, 4, int(lrpb.E_OperationInfo.TypeDescriptor().Number())) // MethodDescriptor.options == 4
 }
 
 // MethodSignature returns the precise location of the method's
 // `google.api.method_signature` annotation, if any.
 func MethodSignature(m *desc.MethodDescriptor, index int) *dpb.SourceCodeInfo_Location {
-	return pathLocation(m, 4, int(apb.E_MethodSignature.Field), index) // MethodDescriptor.options == 4
+	return pathLocation(m, 4, int(apb.E_MethodSignature.TypeDescriptor().Number()), index) // MethodDescriptor.options == 4
 }
diff --git a/rules/aip0203/optional_consistency.go b/rules/aip0203/optional_consistency.go
index 26c42bf..7f6197e 100644
--- a/rules/aip0203/optional_consistency.go
+++ b/rules/aip0203/optional_consistency.go
@@ -27,7 +27,7 @@ var optionalBehaviorConsistency = &lint.MessageRule{
 	OnlyIf: messageHasOptionalFieldBehavior,
 	LintMessage: func(m *desc.MessageDescriptor) (problems []lint.Problem) {
 		for _, f := range m.GetFields() {
-			if utils.GetFieldBehavior(f) == nil {
+			if utils.GetFieldBehavior(f).Len() == 0 {
 				problems = append(problems, lint.Problem{
 					Message:    "Within a single message, either all optional fields should be indicated, or none of them should be.",
 					Descriptor: f,
diff --git a/rules/internal/utils/extension.go b/rules/internal/utils/extension.go
index ed18a74..5ea832c 100644
--- a/rules/internal/utils/extension.go
+++ b/rules/internal/utils/extension.go
@@ -18,17 +18,17 @@ import (
 	"strings"
 
 	"bitbucket.org/creachadair/stringset"
-	"github.com/golang/protobuf/proto"
 	"github.com/jhump/protoreflect/desc"
 	apb "google.golang.org/genproto/googleapis/api/annotations"
 	lrpb "google.golang.org/genproto/googleapis/longrunning"
+	"google.golang.org/protobuf/proto"
 )
 
 // GetFieldBehavior returns a stringset.Set of FieldBehavior annotations for
 // the given field.
 func GetFieldBehavior(f *desc.FieldDescriptor) stringset.Set {
 	opts := f.GetFieldOptions()
-	if x, err := proto.GetExtension(opts, apb.E_FieldBehavior); err == nil {
+	if x := proto.GetExtension(opts, apb.E_FieldBehavior); x != nil {
 		answer := stringset.New()
 		for _, fb := range x.([]apb.FieldBehavior) {
 			answer.Add(fb.String())
@@ -41,7 +41,7 @@ func GetFieldBehavior(f *desc.FieldDescriptor) stringset.Set {
 // GetOperationInfo returns the google.longrunning.operation_info annotation.
 func GetOperationInfo(m *desc.MethodDescriptor) *lrpb.OperationInfo {
 	opts := m.GetMethodOptions()
-	if x, err := proto.GetExtension(opts, lrpb.E_OperationInfo); err == nil {
+	if x := proto.GetExtension(opts, lrpb.E_OperationInfo); x != nil {
 		return x.(*lrpb.OperationInfo)
 	}
 	return nil
@@ -51,7 +51,7 @@ func GetOperationInfo(m *desc.MethodDescriptor) *lrpb.OperationInfo {
 func GetMethodSignatures(m *desc.MethodDescriptor) [][]string {
 	answer := [][]string{}
 	opts := m.GetMethodOptions()
-	if x, err := proto.GetExtension(opts, apb.E_MethodSignature); err == nil {
+	if x := proto.GetExtension(opts, apb.E_MethodSignature); x != nil {
 		for _, sig := range x.([]string) {
 			answer = append(answer, strings.Split(sig, ","))
 		}
@@ -65,7 +65,7 @@ func GetResource(m *desc.MessageDescriptor) *apb.ResourceDescriptor {
 		return nil
 	}
 	opts := m.GetMessageOptions()
-	if x, err := proto.GetExtension(opts, apb.E_Resource); err == nil {
+	if x := proto.GetExtension(opts, apb.E_Resource); x != nil {
 		return x.(*apb.ResourceDescriptor)
 	}
 	return nil
@@ -74,7 +74,7 @@ func GetResource(m *desc.MessageDescriptor) *apb.ResourceDescriptor {
 // GetResourceReference returns the google.api.resource_reference annotation.
 func GetResourceReference(f *desc.FieldDescriptor) *apb.ResourceReference {
 	opts := f.GetFieldOptions()
-	if x, err := proto.GetExtension(opts, apb.E_ResourceReference); err == nil {
+	if x := proto.GetExtension(opts, apb.E_ResourceReference); x != nil {
 		return x.(*apb.ResourceReference)
 	}
 	return nil
diff --git a/rules/internal/utils/http.go b/rules/internal/utils/http.go
index f8dc74b..0c4d338 100644
--- a/rules/internal/utils/http.go
+++ b/rules/internal/utils/http.go
@@ -17,9 +17,9 @@ package utils
 import (
 	"regexp"
 
-	"github.com/golang/protobuf/proto"
 	"github.com/jhump/protoreflect/desc"
 	apb "google.golang.org/genproto/googleapis/api/annotations"
+	"google.golang.org/protobuf/proto"
 )
 
 // GetHTTPRules returns a slice of HTTP rules for a given method descriptor.
@@ -35,7 +35,7 @@ func GetHTTPRules(m *desc.MethodDescriptor) []*HTTPRule {
 	opts := m.GetMethodOptions()
 
 	// Get the "primary" rule (the direct google.api.http annotation).
-	if x, err := proto.GetExtension(opts, apb.E_Http); err == nil {
+	if x := proto.GetExtension(opts, apb.E_Http); x != nil {
 		httpRule := x.(*apb.HttpRule)
 		if parsedRule := parseRule(httpRule); parsedRule != nil {
 			rules = append(rules, parsedRule)


Test patch:
diff --git a/rules/aip0131/http_body_test.go b/rules/aip0131/http_body_test.go
index 2a07781..a0de1e3 100644
--- a/rules/aip0131/http_body_test.go
+++ b/rules/aip0131/http_body_test.go
@@ -18,10 +18,10 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/golang/protobuf/proto"
 	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
 	"github.com/jhump/protoreflect/desc/builder"
 	"google.golang.org/genproto/googleapis/api/annotations"
+	"google.golang.org/protobuf/proto"
 )
 
 func TestHttpBody(t *testing.T) {
@@ -46,9 +46,7 @@ func TestHttpBody(t *testing.T) {
 				},
 				Body: test.body,
 			}
-			if err := proto.SetExtension(opts, annotations.E_Http, httpRule); err != nil {
-				t.Fatalf("Failed to set google.api.http annotation.")
-			}
+			proto.SetExtension(opts, annotations.E_Http, httpRule)
 
 			// Create a minimal service with a AIP-131 Get method
 			// (or with a different method, in the "Irrelevant" case).
diff --git a/rules/aip0131/http_method_test.go b/rules/aip0131/http_method_test.go
index 4a76162..5dbe695 100644
--- a/rules/aip0131/http_method_test.go
+++ b/rules/aip0131/http_method_test.go
@@ -18,10 +18,10 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/golang/protobuf/proto"
 	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
 	"github.com/jhump/protoreflect/desc/builder"
 	"google.golang.org/genproto/googleapis/api/annotations"
+	"google.golang.org/protobuf/proto"
 )
 
 func TestHttpMethod(t *testing.T) {
@@ -54,9 +54,7 @@ func TestHttpMethod(t *testing.T) {
 		t.Run(test.testName, func(t *testing.T) {
 			// Create a MethodOptions with the annotation set.
 			opts := &dpb.MethodOptions{}
-			if err := proto.SetExtension(opts, annotations.E_Http, test.httpRule); err != nil {
-				t.Fatalf("Failed to set google.api.http annotation.")
-			}
+			proto.SetExtension(opts, annotations.E_Http, test.httpRule)
 
 			// Create a minimal service with a AIP-131 Get method
 			// (or with a different method, in the "Irrelevant" case).
diff --git a/rules/aip0133/http_body_test.go b/rules/aip0133/http_body_test.go
index 1efe135..e5416af 100644
--- a/rules/aip0133/http_body_test.go
+++ b/rules/aip0133/http_body_test.go
@@ -18,10 +18,10 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/golang/protobuf/proto"
 	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
 	"github.com/jhump/protoreflect/desc/builder"
 	"google.golang.org/genproto/googleapis/api/annotations"
+	"google.golang.org/protobuf/proto"
 )
 
 func TestHttpBody(t *testing.T) {
@@ -50,12 +50,10 @@ func TestHttpBody(t *testing.T) {
 				},
 				Body: test.body,
 			}
-			if err := proto.SetExtension(opts, annotations.E_Http, httpRule); err != nil {
-				t.Fatalf("Failed to set google.api.http annotation.")
-			}
+			proto.SetExtension(opts, annotations.E_Http, httpRule)
 
+			// Create the book.
 			book, err := builder.NewMessage("Book").Build()
-
 			if err != nil {
 				t.Fatalf("Failed to create resource 'Book' message for test.")
 			}
diff --git a/rules/aip0133/http_method_test.go b/rules/aip0133/http_method_test.go
index 73daac7..8a0fbea 100644
--- a/rules/aip0133/http_method_test.go
+++ b/rules/aip0133/http_method_test.go
@@ -18,10 +18,10 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/golang/protobuf/proto"
 	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
 	"github.com/jhump/protoreflect/desc/builder"
 	"google.golang.org/genproto/googleapis/api/annotations"
+	"google.golang.org/protobuf/proto"
 )
 
 func TestHttpMethod(t *testing.T) {
@@ -54,9 +54,7 @@ func TestHttpMethod(t *testing.T) {
 		t.Run(test.testName, func(t *testing.T) {
 			// Create a MethodOptions with the annotation set.
 			opts := &dpb.MethodOptions{}
-			if err := proto.SetExtension(opts, annotations.E_Http, test.httpRule); err != nil {
-				t.Fatalf("Failed to set google.api.http annotation.")
-			}
+			proto.SetExtension(opts, annotations.E_Http, test.httpRule)
 
 			// Create a minimal service with a AIP-133 Create method
 			// (or with a different method, in the "Irrelevant" case).
diff --git a/rules/aip0134/http_body_test.go b/rules/aip0134/http_body_test.go
index 7f391da..2d23d1d 100644
--- a/rules/aip0134/http_body_test.go
+++ b/rules/aip0134/http_body_test.go
@@ -18,10 +18,10 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/golang/protobuf/proto"
 	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
 	"github.com/jhump/protoreflect/desc/builder"
 	"google.golang.org/genproto/googleapis/api/annotations"
+	"google.golang.org/protobuf/proto"
 )
 
 func TestHttpBody(t *testing.T) {
@@ -48,9 +48,7 @@ func TestHttpBody(t *testing.T) {
 				},
 				Body: test.body,
 			}
-			if err := proto.SetExtension(opts, annotations.E_Http, httpRule); err != nil {
-				t.Fatalf("Failed to set google.api.http annotation.")
-			}
+			proto.SetExtension(opts, annotations.E_Http, httpRule)
 
 			// Create a minimal service with a AIP-134 Update method
 			// (or with a different method, in the "Irrelevant" case).
diff --git a/rules/aip0134/http_method_test.go b/rules/aip0134/http_method_test.go
index deace20..48b0301 100644
--- a/rules/aip0134/http_method_test.go
+++ b/rules/aip0134/http_method_test.go
@@ -18,10 +18,10 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/golang/protobuf/proto"
 	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
 	"github.com/jhump/protoreflect/desc/builder"
 	"google.golang.org/genproto/googleapis/api/annotations"
+	"google.golang.org/protobuf/proto"
 )
 
 func TestHttpMethod(t *testing.T) {
@@ -54,9 +54,7 @@ func TestHttpMethod(t *testing.T) {
 		t.Run(test.testName, func(t *testing.T) {
 			// Create a MethodOptions with the annotation set.
 			opts := &dpb.MethodOptions{}
-			if err := proto.SetExtension(opts, annotations.E_Http, test.httpRule); err != nil {
-				t.Fatalf("Failed to set google.api.http annotation.")
-			}
+			proto.SetExtension(opts, annotations.E_Http, test.httpRule)
 
 			// Create a minimal service with a AIP-134 Update method
 			// (or with a different method, in the "Irrelevant" case).
diff --git a/rules/aip0134/http_uri_name_test.go b/rules/aip0134/http_uri_name_test.go
index 79db440..9593559 100644
--- a/rules/aip0134/http_uri_name_test.go
+++ b/rules/aip0134/http_uri_name_test.go
@@ -18,10 +18,10 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/golang/protobuf/proto"
 	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
 	"github.com/jhump/protoreflect/desc/builder"
 	"google.golang.org/genproto/googleapis/api/annotations"
+	"google.golang.org/protobuf/proto"
 )
 
 func TestHttpNameField(t *testing.T) {
@@ -56,9 +56,7 @@ func TestHttpNameField(t *testing.T) {
 					Patch: test.uri,
 				},
 			}
-			if err := proto.SetExtension(opts, annotations.E_Http, httpRule); err != nil {
-				t.Fatalf("Failed to set google.api.http annotation.")
-			}
+			proto.SetExtension(opts, annotations.E_Http, httpRule)
 
 			// Create a minimal service with a AIP-134 Update method
 			// (or with a different method, in the "Irrelevant" case).
diff --git a/rules/aip0135/http_body_test.go b/rules/aip0135/http_body_test.go
index 6ef711c..4a83cb6 100644
--- a/rules/aip0135/http_body_test.go
+++ b/rules/aip0135/http_body_test.go
@@ -18,10 +18,10 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/golang/protobuf/proto"
 	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
 	"github.com/jhump/protoreflect/desc/builder"
 	"google.golang.org/genproto/googleapis/api/annotations"
+	"google.golang.org/protobuf/proto"
 )
 
 func TestHttpBody(t *testing.T) {
@@ -46,9 +46,7 @@ func TestHttpBody(t *testing.T) {
 				},
 				Body: test.body,
 			}
-			if err := proto.SetExtension(opts, annotations.E_Http, httpRule); err != nil {
-				t.Fatalf("Failed to set google.api.http annotation.")
-			}
+			proto.SetExtension(opts, annotations.E_Http, httpRule)
 
 			// Create a minimal service with a AIP-135 Get method
 			// (or with a different method, in the "Irrelevant" case).
diff --git a/rules/aip0135/http_method_test.go b/rules/aip0135/http_method_test.go
index 2972e84..73e9ec3 100644
--- a/rules/aip0135/http_method_test.go
+++ b/rules/aip0135/http_method_test.go
@@ -18,10 +18,10 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/golang/protobuf/proto"
 	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
 	"github.com/jhump/protoreflect/desc/builder"
 	"google.golang.org/genproto/googleapis/api/annotations"
+	"google.golang.org/protobuf/proto"
 )
 
 func TestHttpMethod(t *testing.T) {
@@ -54,9 +54,7 @@ func TestHttpMethod(t *testing.T) {
 		t.Run(test.testName, func(t *testing.T) {
 			// Create a MethodOptions with the annotation set.
 			opts := &dpb.MethodOptions{}
-			if err := proto.SetExtension(opts, annotations.E_Http, test.httpRule); err != nil {
-				t.Fatalf("Failed to set google.api.http annotation.")
-			}
+			proto.SetExtension(opts, annotations.E_Http, test.httpRule)
 
 			// Create a minimal service with a AIP-135 Delete method
 			// (or with a different method, in the "Irrelevant" case).
diff --git a/rules/aip0135/http_uri_name_test.go b/rules/aip0135/http_uri_name_test.go
index d01a24d..8c8e91c 100644
--- a/rules/aip0135/http_uri_name_test.go
+++ b/rules/aip0135/http_uri_name_test.go
@@ -18,10 +18,10 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/golang/protobuf/proto"
 	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
 	"github.com/jhump/protoreflect/desc/builder"
 	"google.golang.org/genproto/googleapis/api/annotations"
+	"google.golang.org/protobuf/proto"
 )
 
 func TestHttpNameField(t *testing.T) {
@@ -46,9 +46,7 @@ func TestHttpNameField(t *testing.T) {
 					Delete: test.uri,
 				},
 			}
-			if err := proto.SetExtension(opts, annotations.E_Http, httpRule); err != nil {
-				t.Fatalf("Failed to set google.api.http annotation.")
-			}
+			proto.SetExtension(opts, annotations.E_Http, httpRule)
 
 			// Create a minimal service with a AIP-135 Delete method
 			// (or with a different method, in the "Irrelevant" case).
diff --git a/rules/aip0191/file_option_consistency_test.go b/rules/aip0191/file_option_consistency_test.go
index bc5a721..fa21af0 100644
--- a/rules/aip0191/file_option_consistency_test.go
+++ b/rules/aip0191/file_option_consistency_test.go
@@ -19,13 +19,13 @@ import (
 	"sort"
 	"testing"
 
-	"github.com/golang/protobuf/proto"
 	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
 	"github.com/googleapis/api-linter/lint"
 	"github.com/googleapis/api-linter/rules/internal/testutils"
 	"github.com/jhump/protoreflect/desc"
 	"github.com/jhump/protoreflect/desc/builder"
 	"github.com/stoewer/go-strcase"
+	"google.golang.org/protobuf/proto"
 )
 
 func TestFileOptionConsistency(t *testing.T) {
diff --git a/rules/aip0203/optional_consistency_test.go b/rules/aip0203/optional_consistency_test.go
index f6ad1d4..867da9b 100644
--- a/rules/aip0203/optional_consistency_test.go
+++ b/rules/aip0203/optional_consistency_test.go
@@ -75,11 +75,11 @@ string author = 4;`,
 	for _, test := range testCases {
 		t.Run(test.name, func(t *testing.T) {
 			template := `
-import "google/api/field_behavior.proto";
-message Book {
-	// Title of the book
-	{{.Field}}
-}`
+				import "google/api/field_behavior.proto";
+				message Book {
+					// Title of the book
+					{{.Field}}
+				}`
 			file := testutils.ParseProto3Tmpl(t, template, struct{ Field string }{test.field})
 			// author field in the test will get the warning
 			f := file.GetMessageTypes()[0].GetFields()[3]
diff --git a/rules/aip0231/http_body_test.go b/rules/aip0231/http_body_test.go
index 923bbbb..d02a3d0 100644
--- a/rules/aip0231/http_body_test.go
+++ b/rules/aip0231/http_body_test.go
@@ -17,11 +17,11 @@ package aip0231
 import (
 	"testing"
 
-	"github.com/golang/protobuf/proto"
 	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
 	"github.com/googleapis/api-linter/rules/internal/testutils"
 	"github.com/jhump/protoreflect/desc/builder"
 	"google.golang.org/genproto/googleapis/api/annotations"
+	"google.golang.org/protobuf/proto"
 )
 
 func TestHttpBody(t *testing.T) {
@@ -46,9 +46,7 @@ func TestHttpBody(t *testing.T) {
 				},
 				Body: test.body,
 			}
-			if err := proto.SetExtension(opts, annotations.E_Http, httpRule); err != nil {
-				t.Fatalf("Failed to set google.api.http annotation.")
-			}
+			proto.SetExtension(opts, annotations.E_Http, httpRule)
 
 			// Create a minimal service with a AIP-231 Get method
 			// (or with a different method, in the "Irrelevant" case).
diff --git a/rules/aip0231/http_method_test.go b/rules/aip0231/http_method_test.go
index bf2e242..ec62211 100644
--- a/rules/aip0231/http_method_test.go
+++ b/rules/aip0231/http_method_test.go
@@ -17,11 +17,11 @@ package aip0231
 import (
 	"testing"
 
-	"github.com/golang/protobuf/proto"
 	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
 	"github.com/googleapis/api-linter/rules/internal/testutils"
 	"github.com/jhump/protoreflect/desc/builder"
 	"google.golang.org/genproto/googleapis/api/annotations"
+	"google.golang.org/protobuf/proto"
 )
 
 func TestHttpVerb(t *testing.T) {
@@ -54,9 +54,7 @@ func TestHttpVerb(t *testing.T) {
 		t.Run(test.testName, func(t *testing.T) {
 			// Create a MethodOptions with the annotation set.
 			opts := &dpb.MethodOptions{}
-			if err := proto.SetExtension(opts, annotations.E_Http, test.httpRule); err != nil {
-				t.Fatalf("Failed to set google.api.http annotation.")
-			}
+			proto.SetExtension(opts, annotations.E_Http, test.httpRule)
 
 			// Create a minimal service with a AIP-231 Get method
 			// (or with a different method, in the "Irrelevant" case).
diff --git a/rules/aip0231/http_uri_suffix_test.go b/rules/aip0231/http_uri_suffix_test.go
index 7532613..9568c41 100644
--- a/rules/aip0231/http_uri_suffix_test.go
+++ b/rules/aip0231/http_uri_suffix_test.go
@@ -17,11 +17,11 @@ package aip0231
 import (
 	"testing"
 
-	"github.com/golang/protobuf/proto"
 	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
 	"github.com/googleapis/api-linter/rules/internal/testutils"
 	"github.com/jhump/protoreflect/desc/builder"
 	"google.golang.org/genproto/googleapis/api/annotations"
+	"google.golang.org/protobuf/proto"
 )
 
 func TestHttpUrl(t *testing.T) {
@@ -45,9 +45,7 @@ func TestHttpUrl(t *testing.T) {
 					Get: test.uri,
 				},
 			}
-			if err := proto.SetExtension(opts, annotations.E_Http, httpRule); err != nil {
-				t.Fatalf("Failed to set google.api.http annotation.")
-			}
+			proto.SetExtension(opts, annotations.E_Http, httpRule)
 
 			// Create a minimal service with a AIP-231 Get method
 			// (or with a different method, in the "Irrelevant" case).
diff --git a/rules/internal/utils/extension_test.go b/rules/internal/utils/extension_test.go
index cea2390..1c47116 100644
--- a/rules/internal/utils/extension_test.go
+++ b/rules/internal/utils/extension_test.go
@@ -43,7 +43,7 @@ func TestGetFieldBehavior(t *testing.T) {
 	}{
 		{"name", stringset.New("IMMUTABLE", "OUTPUT_ONLY")},
 		{"title", stringset.New("REQUIRED")},
-		{"summary", nil},
+		{"summary", stringset.New()},
 	}
 	for _, test := range tests {
 		t.Run(test.fieldName, func(t *testing.T) {