fix(kzip info): trim extra spaces from error message
this works around the fact that log("%v", proto) is inconsistent about spacing in open source go vs google3
@@ -20,6 +20,7 @@ package info // import "kythe.io/kythe/go/platform/kzip/info"
import (
"fmt"
"log"
+ "strings"
"bitbucket.org/creachadair/stringset"
@@ -52,7 +53,8 @@ func KzipInfo(f kzip.File, fileSize int64, scanOpts ...kzip.ScanOption) (*apb.Kz
for _, ri := range u.Proto.RequiredInput {
riCorpus := requiredInputCorpus(u, ri)
if riCorpus == "" {
- msg := fmt.Sprintf("unable to determine corpus for required_input %q in CU %v", ri.Info.Path, u.Proto.GetVName())
+ // Trim spaces to work around the fact that log("%v", proto) is inconsistent about trailing spaces in google3 vs open-source go.
+ msg := strings.TrimSpace(fmt.Sprintf("unable to determine corpus for required_input %q in CU %v", ri.Info.Path, u.Proto.GetVName()))
kzipInfo.CriticalKzipErrors = append(kzipInfo.CriticalKzipErrors, msg)
return nil
}
