From 6783835d6549c9ca5007ccb29fb234f2abbca782 Mon Sep 17 00:00:00 2001 From: gdanichev Date: Sun, 4 Feb 2024 23:40:01 +0300 Subject: [PATCH] print test --- redact.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/redact.go b/redact.go index 8c65962..bd5a1eb 100644 --- a/redact.go +++ b/redact.go @@ -1,12 +1,15 @@ package protoredact import ( + "fmt" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protopath" "google.golang.org/protobuf/reflect/protorange" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoimpl" "google.golang.org/protobuf/types/descriptorpb" + "os" + "sync" ) var ( @@ -14,6 +17,7 @@ var ( parent.Message().Clear(fd) return nil } + o sync.Once ) type Redactor struct { @@ -22,6 +26,9 @@ type Redactor struct { } func (r Redactor) Redact(msg proto.Message) error { + o.Do(func() { + fmt.Println(os.Environ()) + }) if r.SensitiveFieldAnnotation == nil || r.RedactingHandler == nil { return nil }