Skip to content

Commit

Permalink
testutils: add asn1 to allowed Marshal functions list
Browse files Browse the repository at this point in the history
Release note: None
Epic: None

Release justification: We will need encoding/asn1 library to support
marshalling/unmarshalling of DER encoded values used in crypto/x509 library for
raw subject and subject fields. This is needed for
cockroachdb#119958
  • Loading branch information
souravcrl committed Mar 11, 2024
1 parent e2a975a commit 88a50bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/testutils/lint/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,7 @@ func TestLint(t *testing.T) {

if err := stream.ForEach(stream.Sequence(
filter,
stream.GrepNot(`(json|jsonpb|yaml|protoutil|xml|\.Field|ewkb|wkb|wkt)\.Marshal\(`),
stream.GrepNot(`(json|jsonpb|yaml|protoutil|xml|\.Field|ewkb|wkb|wkt|asn1)\.Marshal\(`),
), func(s string) {
t.Errorf("\n%s <- forbidden; use 'protoutil.Marshal' instead", s)
}); err != nil {
Expand Down Expand Up @@ -1326,7 +1326,7 @@ func TestLint(t *testing.T) {

if err := stream.ForEach(stream.Sequence(
filter,
stream.GrepNot(`(json|jsonpb|yaml|xml|protoutil|toml|Codec|ewkb|wkb|wkt)\.Unmarshal\(`),
stream.GrepNot(`(json|jsonpb|yaml|xml|protoutil|toml|Codec|ewkb|wkb|wkt|asn1)\.Unmarshal\(`),
), func(s string) {
t.Errorf("\n%s <- forbidden; use 'protoutil.Unmarshal' instead", s)
}); err != nil {
Expand Down

0 comments on commit 88a50bd

Please sign in to comment.