Remove unnecessary snake case variables.
Test: m nothing + TreeHugger
Change-Id: I99f7162944daa6c57c6ae4763261e108bb5cb6b1
diff --git a/ui/build/config.go b/ui/build/config.go
index ecca4de..1152cd7 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -617,19 +617,19 @@
// For LANG and LC_*, only preserve the evaluated version of
// LC_MESSAGES
- user_lang := ""
+ userLang := ""
if lc_all, ok := c.environ.Get("LC_ALL"); ok {
- user_lang = lc_all
+ userLang = lc_all
} else if lc_messages, ok := c.environ.Get("LC_MESSAGES"); ok {
- user_lang = lc_messages
+ userLang = lc_messages
} else if lang, ok := c.environ.Get("LANG"); ok {
- user_lang = lang
+ userLang = lang
}
c.environ.UnsetWithPrefix("LC_")
- if user_lang != "" {
- c.environ.Set("LC_MESSAGES", user_lang)
+ if userLang != "" {
+ c.environ.Set("LC_MESSAGES", userLang)
}
// The for LANG, use C.UTF-8 if it exists (Debian currently, proposed
diff --git a/ui/build/dumpvars.go b/ui/build/dumpvars.go
index 999af07..fe0aca9 100644
--- a/ui/build/dumpvars.go
+++ b/ui/build/dumpvars.go
@@ -254,7 +254,7 @@
"BUILD_BROKEN_USES_BUILD_STATIC_LIBRARY",
}, exportEnvVars...), BannerVars...)
- make_vars, err := dumpMakeVars(ctx, config, config.Arguments(), allVars, true, "")
+ makeVars, err := dumpMakeVars(ctx, config, config.Arguments(), allVars, true, "")
if err != nil {
ctx.Fatalln("Error dumping make vars:", err)
}
@@ -262,24 +262,24 @@
env := config.Environment()
// Print the banner like make does
if !env.IsEnvTrue("ANDROID_QUIET_BUILD") {
- fmt.Fprintln(ctx.Writer, Banner(make_vars))
+ fmt.Fprintln(ctx.Writer, Banner(makeVars))
}
// Populate the environment
for _, name := range exportEnvVars {
- if make_vars[name] == "" {
+ if makeVars[name] == "" {
env.Unset(name)
} else {
- env.Set(name, make_vars[name])
+ env.Set(name, makeVars[name])
}
}
- config.SetKatiArgs(strings.Fields(make_vars["KATI_GOALS"]))
- config.SetNinjaArgs(strings.Fields(make_vars["NINJA_GOALS"]))
- config.SetTargetDevice(make_vars["TARGET_DEVICE"])
- config.SetTargetDeviceDir(make_vars["TARGET_DEVICE_DIR"])
+ config.SetKatiArgs(strings.Fields(makeVars["KATI_GOALS"]))
+ config.SetNinjaArgs(strings.Fields(makeVars["NINJA_GOALS"]))
+ config.SetTargetDevice(makeVars["TARGET_DEVICE"])
+ config.SetTargetDeviceDir(makeVars["TARGET_DEVICE_DIR"])
- config.SetBuildBrokenDupRules(make_vars["BUILD_BROKEN_DUP_RULES"] == "true")
- config.SetBuildBrokenUsesNetwork(make_vars["BUILD_BROKEN_USES_NETWORK"] == "true")
- config.SetBuildBrokenNinjaUsesEnvVars(strings.Fields(make_vars["BUILD_BROKEN_NINJA_USES_ENV_VARS"]))
+ config.SetBuildBrokenDupRules(makeVars["BUILD_BROKEN_DUP_RULES"] == "true")
+ config.SetBuildBrokenUsesNetwork(makeVars["BUILD_BROKEN_USES_NETWORK"] == "true")
+ config.SetBuildBrokenNinjaUsesEnvVars(strings.Fields(makeVars["BUILD_BROKEN_NINJA_USES_ENV_VARS"]))
}
diff --git a/ui/build/test_build.go b/ui/build/test_build.go
index 41acc26..a910c06 100644
--- a/ui/build/test_build.go
+++ b/ui/build/test_build.go
@@ -50,10 +50,10 @@
// Get a list of leaf nodes in the dependency graph from ninja
executable := config.PrebuiltBuildTool("ninja")
- common_args := []string{}
- common_args = append(common_args, config.NinjaArgs()...)
- common_args = append(common_args, "-f", config.CombinedNinjaFile())
- args := append(common_args, "-t", "targets", "rule")
+ commonArgs := []string{}
+ commonArgs = append(commonArgs, config.NinjaArgs()...)
+ commonArgs = append(commonArgs, "-f", config.CombinedNinjaFile())
+ args := append(commonArgs, "-t", "targets", "rule")
cmd := Command(ctx, config, "ninja", executable, args...)
stdout, err := cmd.StdoutPipe()
@@ -114,28 +114,28 @@
title := "Dependencies in out found with no rule to create them:"
fmt.Fprintln(sb, title)
- report_lines := 1
+ reportLines := 1
for i, dep := range danglingRulesList {
- if report_lines > 20 {
+ if reportLines > 20 {
fmt.Fprintf(sb, " ... and %d more\n", len(danglingRulesList)-i)
break
}
// It's helpful to see the reverse dependencies. ninja -t query is the
// best tool we got for that. Its output starts with the dependency
// itself.
- query_cmd := Command(ctx, config, "ninja", executable,
- append(common_args, "-t", "query", dep)...)
- query_stdout, err := query_cmd.StdoutPipe()
+ queryCmd := Command(ctx, config, "ninja", executable,
+ append(commonArgs, "-t", "query", dep)...)
+ queryStdout, err := queryCmd.StdoutPipe()
if err != nil {
ctx.Fatal(err)
}
- query_cmd.StartOrFatal()
- scanner := bufio.NewScanner(query_stdout)
+ queryCmd.StartOrFatal()
+ scanner := bufio.NewScanner(queryStdout)
for scanner.Scan() {
- report_lines++
+ reportLines++
fmt.Fprintln(sb, " ", scanner.Text())
}
- query_cmd.WaitOrFatal()
+ queryCmd.WaitOrFatal()
}
ts.FinishAction(status.ActionResult{
diff --git a/ui/terminal/util.go b/ui/terminal/util.go
index 7a603d7..28d97fe 100644
--- a/ui/terminal/util.go
+++ b/ui/terminal/util.go
@@ -41,13 +41,13 @@
func termSize(w io.Writer) (width int, height int, ok bool) {
if f, ok := w.(*os.File); ok {
var winsize struct {
- ws_row, ws_column uint16
- ws_xpixel, ws_ypixel uint16
+ wsRow, wsColumn uint16
+ wsXpixel, wsYpixel uint16
}
_, _, err := syscall.Syscall6(syscall.SYS_IOCTL, f.Fd(),
syscall.TIOCGWINSZ, uintptr(unsafe.Pointer(&winsize)),
0, 0, 0)
- return int(winsize.ws_column), int(winsize.ws_row), err == 0
+ return int(winsize.wsColumn), int(winsize.wsRow), err == 0
} else if f, ok := w.(*fakeSmartTerminal); ok {
return f.termWidth, f.termHeight, true
}