Greater-than zero is more idiomatic.
Test: m all
Change-Id: I6000d937b98c84226a347b69c69b333a15beb355
diff --git a/tools/compliance/cmd/htmlnotice/htmlnotice.go b/tools/compliance/cmd/htmlnotice/htmlnotice.go
index 0e3ba09..ffb0585 100644
--- a/tools/compliance/cmd/htmlnotice/htmlnotice.go
+++ b/tools/compliance/cmd/htmlnotice/htmlnotice.go
@@ -204,17 +204,17 @@
fmt.Fprintln(ctx.stdout, "li { padding-left: 1em; }")
fmt.Fprintln(ctx.stdout, ".file-list { margin-left: 1em; }")
fmt.Fprintln(ctx.stdout, "</style>")
- if 0 < len(ctx.title) {
+ if len(ctx.title) > 0 {
fmt.Fprintf(ctx.stdout, "<title>%s</title>\n", html.EscapeString(ctx.title))
- } else if 0 < len(ctx.product) {
+ } else if len(ctx.product) > 0 {
fmt.Fprintf(ctx.stdout, "<title>%s</title>\n", html.EscapeString(ctx.product))
}
fmt.Fprintln(ctx.stdout, "</head>")
fmt.Fprintln(ctx.stdout, "<body>")
- if 0 < len(ctx.title) {
+ if len(ctx.title) > 0 {
fmt.Fprintf(ctx.stdout, " <h1>%s</h1>\n", html.EscapeString(ctx.title))
- } else if 0 < len(ctx.product) {
+ } else if len(ctx.product) > 0 {
fmt.Fprintf(ctx.stdout, " <h1>%s</h1>\n", html.EscapeString(ctx.product))
}
ids := make(map[string]string)
diff --git a/tools/compliance/cmd/htmlnotice/htmlnotice_test.go b/tools/compliance/cmd/htmlnotice/htmlnotice_test.go
index b8bc47f..1b01d16 100644
--- a/tools/compliance/cmd/htmlnotice/htmlnotice_test.go
+++ b/tools/compliance/cmd/htmlnotice/htmlnotice_test.go
@@ -678,7 +678,7 @@
}
if !inBody {
if expectTitle {
- if tl := checkTitle(line); 0 < len(tl) {
+ if tl := checkTitle(line); len(tl) > 0 {
if tl != ttle.t {
t.Errorf("htmlnotice: unexpected title: got %q, want %q", tl, ttle.t)
}