Print a warning on redundant overrides

Bug: 328495189
Test: manual
Change-Id: I35bff9d6751e9aa304e4c2d7e24b9a44a3994264
This commit is contained in:
LaMont Jones
2024-04-11 11:50:06 -07:00
parent f018d726ca
commit 7ac07deb9b
3 changed files with 28 additions and 3 deletions

View File

@@ -25,6 +25,8 @@ import (
"google.golang.org/protobuf/proto"
)
var disableWarnings bool
type StringList []string
func (l *StringList) Set(v string) error {
@@ -62,6 +64,18 @@ func WalkTextprotoFiles(root string, subdir string, Func fs.WalkDirFunc) error {
})
}
// Turn off all warning output
func DisableWarnings() {
disableWarnings = true
}
func warnf(format string, args ...any) (n int, err error) {
if !disableWarnings {
return fmt.Printf(format, args...)
}
return 0, nil
}
func GetDefaultOutDir() string {
outEnv := os.Getenv("OUT_DIR")
if outEnv == "" {