summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2023-10-18 17:38:40 -0700
committer Cole Faust <colefaust@google.com> 2023-10-18 17:42:59 -0700
commit06ea531ab30026dcddbe609ed71f951d4f7ffd5b (patch)
tree2a953171a46f25c2423b4a6b20c7dcb839bc1924
parent03787bea6d58171c084ea8840f3a717137f60687 (diff)
gofmt soong
Test: Presubmits Change-Id: Ia76c35ba51685eca29df51738000eacd3f43ce20
-rw-r--r--android/allowlists/allowlists.go2
-rw-r--r--android/bazel_paths.go6
-rw-r--r--cc/bp2build.go6
-rw-r--r--cc/fuzz.go14
-rw-r--r--cc/orderfile.go15
-rw-r--r--cc/orderfile_test.go24
-rw-r--r--java/bootclasspath_fragment.go2
-rw-r--r--java/dexpreopt_bootjars.go6
-rw-r--r--java/dexpreopt_config.go4
-rw-r--r--java/dexpreopt_config_testing.go2
-rw-r--r--ui/build/config.go2
11 files changed, 41 insertions, 42 deletions
diff --git a/android/allowlists/allowlists.go b/android/allowlists/allowlists.go
index 014b3cc00..3e8b318b3 100644
--- a/android/allowlists/allowlists.go
+++ b/android/allowlists/allowlists.go
@@ -437,7 +437,7 @@ var (
"system/libprocinfo": Bp2BuildDefaultTrue,
"system/libvintf": Bp2BuildDefaultTrue,
"system/libziparchive": Bp2BuildDefaultTrueRecursively,
- "system/linkerconfig": Bp2BuildDefaultTrueRecursively,
+ "system/linkerconfig": Bp2BuildDefaultTrueRecursively,
"system/logging": Bp2BuildDefaultTrueRecursively,
"system/media": Bp2BuildDefaultTrue,
"system/media/alsa_utils": Bp2BuildDefaultTrueRecursively,
diff --git a/android/bazel_paths.go b/android/bazel_paths.go
index d272ec2db..f25803ccc 100644
--- a/android/bazel_paths.go
+++ b/android/bazel_paths.go
@@ -103,7 +103,7 @@ type BazelConversionPathContext interface {
// or ":<module>") and returns a Bazel-compatible label which corresponds to dependencies on the
// module within the given ctx.
func BazelLabelForModuleDeps(ctx Bp2buildMutatorContext, modules []string) bazel.LabelList {
- return BazelLabelForModuleDepsWithFn(ctx, modules, BazelModuleLabel, /*markAsDeps=*/true)
+ return BazelLabelForModuleDepsWithFn(ctx, modules, BazelModuleLabel, true)
}
// BazelLabelForModuleWholeDepsExcludes expects two lists: modules (containing modules to include in
@@ -154,11 +154,11 @@ func BazelLabelForModuleDepsWithFn(ctx Bp2buildMutatorContext, modules []string,
// the excluded dependencies.
func BazelLabelForModuleDepsExcludesWithFn(ctx Bp2buildMutatorContext, modules, excludes []string,
moduleToLabelFn func(BazelConversionPathContext, blueprint.Module) string) bazel.LabelList {
- moduleLabels := BazelLabelForModuleDepsWithFn(ctx, RemoveListFromList(modules, excludes), moduleToLabelFn, /*markAsDeps=*/true)
+ moduleLabels := BazelLabelForModuleDepsWithFn(ctx, RemoveListFromList(modules, excludes), moduleToLabelFn, true)
if len(excludes) == 0 {
return moduleLabels
}
- excludeLabels := BazelLabelForModuleDepsWithFn(ctx, excludes, moduleToLabelFn, /*markAsDeps=*/false)
+ excludeLabels := BazelLabelForModuleDepsWithFn(ctx, excludes, moduleToLabelFn, false)
return bazel.LabelList{
Includes: moduleLabels.Includes,
Excludes: excludeLabels.Includes,
diff --git a/cc/bp2build.go b/cc/bp2build.go
index 57333b85e..7ae8d8981 100644
--- a/cc/bp2build.go
+++ b/cc/bp2build.go
@@ -1904,7 +1904,7 @@ func xsdConfigCppTarget(xsd android.XsdConfigBp2buildTargets) string {
}
func bazelLabelForWholeDeps(ctx android.Bp2buildMutatorContext, modules []string) bazel.LabelList {
- return android.BazelLabelForModuleDepsWithFn(ctx, modules, bazelLabelForStaticWholeModuleDeps, /*markAsDeps=*/true)
+ return android.BazelLabelForModuleDepsWithFn(ctx, modules, bazelLabelForStaticWholeModuleDeps, true)
}
func bazelLabelForWholeDepsExcludes(ctx android.Bp2buildMutatorContext, modules, excludes []string) bazel.LabelList {
@@ -1916,11 +1916,11 @@ func bazelLabelForStaticDepsExcludes(ctx android.Bp2buildMutatorContext, modules
}
func bazelLabelForStaticDeps(ctx android.Bp2buildMutatorContext, modules []string) bazel.LabelList {
- return android.BazelLabelForModuleDepsWithFn(ctx, modules, bazelLabelForStaticModule, /*markAsDeps=*/true)
+ return android.BazelLabelForModuleDepsWithFn(ctx, modules, bazelLabelForStaticModule, true)
}
func bazelLabelForSharedDeps(ctx android.Bp2buildMutatorContext, modules []string) bazel.LabelList {
- return android.BazelLabelForModuleDepsWithFn(ctx, modules, bazelLabelForSharedModule, /*markAsDeps=*/true)
+ return android.BazelLabelForModuleDepsWithFn(ctx, modules, bazelLabelForSharedModule, true)
}
func bazelLabelForHeaderDeps(ctx android.Bp2buildMutatorContext, modules []string) bazel.LabelList {
diff --git a/cc/fuzz.go b/cc/fuzz.go
index 227fe8bcf..df9f21ad2 100644
--- a/cc/fuzz.go
+++ b/cc/fuzz.go
@@ -357,10 +357,10 @@ func NewFuzzer(hod android.HostOrDeviceSupported) *Module {
// their architecture & target/host specific zip file.
type ccRustFuzzPackager struct {
fuzz.FuzzPackager
- fuzzPackagingArchModules string
- fuzzTargetSharedDepsInstallPairs string
- allFuzzTargetsName string
- onlyIncludePresubmits bool
+ fuzzPackagingArchModules string
+ fuzzTargetSharedDepsInstallPairs string
+ allFuzzTargetsName string
+ onlyIncludePresubmits bool
}
func fuzzPackagingFactory() android.Singleton {
@@ -369,7 +369,7 @@ func fuzzPackagingFactory() android.Singleton {
fuzzPackagingArchModules: "SOONG_FUZZ_PACKAGING_ARCH_MODULES",
fuzzTargetSharedDepsInstallPairs: "FUZZ_TARGET_SHARED_DEPS_INSTALL_PAIRS",
allFuzzTargetsName: "ALL_FUZZ_TARGETS",
- onlyIncludePresubmits: false,
+ onlyIncludePresubmits: false,
}
return fuzzPackager
}
@@ -380,7 +380,7 @@ func fuzzPackagingFactoryPresubmit() android.Singleton {
fuzzPackagingArchModules: "SOONG_PRESUBMIT_FUZZ_PACKAGING_ARCH_MODULES",
fuzzTargetSharedDepsInstallPairs: "PRESUBMIT_FUZZ_TARGET_SHARED_DEPS_INSTALL_PAIRS",
allFuzzTargetsName: "ALL_PRESUBMIT_FUZZ_TARGETS",
- onlyIncludePresubmits: true,
+ onlyIncludePresubmits: true,
}
return fuzzPackager
}
@@ -451,7 +451,7 @@ func (s *ccRustFuzzPackager) GenerateBuildActions(ctx android.SingletonContext)
if fpm.FuzzProperties.Fuzz_config == nil {
return
}
- if !BoolDefault(fpm.FuzzProperties.Fuzz_config.Use_for_presubmit, false){
+ if !BoolDefault(fpm.FuzzProperties.Fuzz_config.Use_for_presubmit, false) {
return
}
}
diff --git a/cc/orderfile.go b/cc/orderfile.go
index b64c1c7a1..9192e8168 100644
--- a/cc/orderfile.go
+++ b/cc/orderfile.go
@@ -58,17 +58,17 @@ func recordMissingOrderfile(ctx BaseModuleContext, missing string) {
type OrderfileProperties struct {
Orderfile struct {
- Instrumentation *bool
- Order_file_path *string `android:"arch_variant"`
- Load_order_file *bool `android:"arch_variant"`
+ Instrumentation *bool
+ Order_file_path *string `android:"arch_variant"`
+ Load_order_file *bool `android:"arch_variant"`
// Additional compiler flags to use when building this module
// for orderfile profiling.
Cflags []string `android:"arch_variant"`
} `android:"arch_variant"`
- ShouldProfileModule bool `blueprint:"mutated"`
- OrderfileLoad bool `blueprint:"mutated"`
- OrderfileInstrLink bool `blueprint:"mutated"`
+ ShouldProfileModule bool `blueprint:"mutated"`
+ OrderfileLoad bool `blueprint:"mutated"`
+ OrderfileInstrLink bool `blueprint:"mutated"`
}
type orderfile struct {
@@ -128,7 +128,6 @@ func (props *OrderfileProperties) addInstrumentationProfileGatherFlags(ctx Modul
return flags
}
-
func (props *OrderfileProperties) loadOrderfileFlags(ctx ModuleContext, file string) []string {
flags := []string{fmt.Sprintf(orderfileUseFormat, file)}
flags = append(flags, orderfileOtherFlags...)
@@ -217,7 +216,7 @@ func orderfileDepsMutator(mctx android.TopDownMutatorContext) {
if dep, ok := dep.(*Module); ok {
if m.orderfile.Properties.OrderfileInstrLink {
- dep.orderfile.Properties.OrderfileInstrLink = true;
+ dep.orderfile.Properties.OrderfileInstrLink = true
}
}
diff --git a/cc/orderfile_test.go b/cc/orderfile_test.go
index f68457d32..3486f964c 100644
--- a/cc/orderfile_test.go
+++ b/cc/orderfile_test.go
@@ -15,8 +15,8 @@
package cc
import (
- "testing"
"strings"
+ "testing"
"android/soong/android"
)
@@ -193,8 +193,8 @@ func TestOrderfileProfilePropagateStaticDeps(t *testing.T) {
}
// Check cFlags of orderfile variant static libraries
- libFooOfVariant := result.ModuleForTests("libFoo", "android_arm64_armv8-a_static_orderfile")
- libBarOfVariant := result.ModuleForTests("libBar", "android_arm64_armv8-a_static_orderfile")
+ libFooOfVariant := result.ModuleForTests("libFoo", "android_arm64_armv8-a_static_orderfile")
+ libBarOfVariant := result.ModuleForTests("libBar", "android_arm64_armv8-a_static_orderfile")
cFlags = libFooOfVariant.Rule("cc").Args["cFlags"]
if !strings.Contains(cFlags, expectedCFlag) {
@@ -216,8 +216,8 @@ func TestOrderfileProfilePropagateStaticDeps(t *testing.T) {
}
// Check cFlags of the non-orderfile variant static libraries
- libFoo := result.ModuleForTests("libFoo", "android_arm64_armv8-a_static")
- libBar := result.ModuleForTests("libBar", "android_arm64_armv8-a_static")
+ libFoo := result.ModuleForTests("libFoo", "android_arm64_armv8-a_static")
+ libBar := result.ModuleForTests("libBar", "android_arm64_armv8-a_static")
cFlags = libFoo.Rule("cc").Args["cFlags"]
if strings.Contains(cFlags, expectedCFlag) {
@@ -281,8 +281,8 @@ func TestOrderfileLoadPropagateStaticDeps(t *testing.T) {
t.Errorf("Expected 'libTest' to load orderfile, but did not find %q in ldFlags %q", expectedCFlag, ldFlags)
}
- libFoo := result.ModuleForTests("libFoo", "android_arm64_armv8-a_static")
- libBar := result.ModuleForTests("libBar", "android_arm64_armv8-a_static")
+ libFoo := result.ModuleForTests("libFoo", "android_arm64_armv8-a_static")
+ libBar := result.ModuleForTests("libBar", "android_arm64_armv8-a_static")
// Check dependency edge from orderfile-enabled module to non-orderfile variant static libraries
if !hasDirectDep(result, libTest.Module(), libFoo.Module()) {
@@ -351,8 +351,8 @@ func TestOrderfileProfilePropagateSharedDeps(t *testing.T) {
}
// Check cFlags of the static and shared libraries
- libFoo := result.ModuleForTests("libFoo", "android_arm64_armv8-a_shared")
- libBar := result.ModuleForTests("libBar", "android_arm64_armv8-a_static")
+ libFoo := result.ModuleForTests("libFoo", "android_arm64_armv8-a_shared")
+ libBar := result.ModuleForTests("libBar", "android_arm64_armv8-a_static")
cFlags = libFoo.Rule("cc").Args["cFlags"]
if strings.Contains(cFlags, expectedCFlag) {
@@ -431,8 +431,8 @@ func TestOrderfileProfileStaticLibrary(t *testing.T) {
}
// Check cFlags of the static libraries
- libFoo := result.ModuleForTests("libFoo", "android_arm64_armv8-a_static")
- libBar := result.ModuleForTests("libBar", "android_arm64_armv8-a_static")
+ libFoo := result.ModuleForTests("libFoo", "android_arm64_armv8-a_static")
+ libBar := result.ModuleForTests("libBar", "android_arm64_armv8-a_static")
cFlags = libFoo.Rule("cc").Args["cFlags"]
if strings.Contains(cFlags, expectedCFlag) {
@@ -467,4 +467,4 @@ func TestOrderfileProfileStaticLibrary(t *testing.T) {
t.Errorf("Expected variants for 'libBar' to not contain 'orderfile', but found %q", v)
}
}
-} \ No newline at end of file
+}
diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go
index dcc2dece7..d15dbc991 100644
--- a/java/bootclasspath_fragment.go
+++ b/java/bootclasspath_fragment.go
@@ -782,7 +782,7 @@ func (b *BootclasspathFragmentModule) produceBootImageProfileFromSource(ctx andr
dexLocations := make([]string, 0, len(contents))
for _, module := range contents {
dexPaths = append(dexPaths, modules[module.Name()])
- dexLocations = append(dexLocations, filepath.Join("/", "apex", apex, "javalib", module.Name() + ".jar"))
+ dexLocations = append(dexLocations, filepath.Join("/", "apex", apex, "javalib", module.Name()+".jar"))
}
// Build a profile for the modules in this fragment.
diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go
index 003f2de22..c0f73afc5 100644
--- a/java/dexpreopt_bootjars.go
+++ b/java/dexpreopt_bootjars.go
@@ -628,7 +628,7 @@ func generateBootImage(ctx android.ModuleContext, imageConfig *bootImageConfig)
}
type apexJarModulePair struct {
- apex string
+ apex string
jarModule android.Module
}
@@ -640,7 +640,7 @@ func getModulesForImage(ctx android.ModuleContext, imageConfig *bootImageConfig)
name := android.RemoveOptionalPrebuiltPrefix(module.Name())
if name == imageConfig.modules.Jar(i) {
modules = append(modules, apexJarModulePair{
- apex: imageConfig.modules.Apex(i),
+ apex: imageConfig.modules.Apex(i),
jarModule: module,
})
found = true
@@ -1178,7 +1178,7 @@ func dumpOatRules(ctx android.ModuleContext, image *bootImageConfig) {
Rule: android.Phony,
Output: phony,
Inputs: allPhonies,
- Description: "dump-oat-"+name,
+ Description: "dump-oat-" + name,
})
}
diff --git a/java/dexpreopt_config.go b/java/dexpreopt_config.go
index 0f4bd9b34..29551efcc 100644
--- a/java/dexpreopt_config.go
+++ b/java/dexpreopt_config.go
@@ -278,7 +278,7 @@ func getDexpreoptDirName(ctx android.PathContext) string {
prefix := "dexpreopt_"
targets := ctx.Config().Targets[android.Android]
if len(targets) > 0 {
- return prefix+targets[0].Arch.ArchType.String()
+ return prefix + targets[0].Arch.ArchType.String()
}
- return prefix+"unknown_target"
+ return prefix + "unknown_target"
}
diff --git a/java/dexpreopt_config_testing.go b/java/dexpreopt_config_testing.go
index 176c251fd..41d4b72a1 100644
--- a/java/dexpreopt_config_testing.go
+++ b/java/dexpreopt_config_testing.go
@@ -77,7 +77,7 @@ var ApexBootJarDexJarPaths = []string{
func PrepareApexBootJarModule(apexName string, moduleName string) android.FixturePreparer {
moduleSourceDir := fmt.Sprintf("packages/modules/%s", apexName)
- fragmentName := apexName+"-bootclasspath-fragment"
+ fragmentName := apexName + "-bootclasspath-fragment"
imageNameProp := ""
if apexName == "com.android.art" {
fragmentName = "art-bootclasspath-fragment"
diff --git a/ui/build/config.go b/ui/build/config.go
index 264d83e70..5925b283c 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -1348,7 +1348,7 @@ func (c *configImpl) rbeProxyLogsDir() string {
}
func (c *configImpl) rbeDownloadTmpDir() string {
- for _, f := range []string{"RBE_download_tmp_dir", "FLAG_download_tmp_dir"} {
+ for _, f := range []string{"RBE_download_tmp_dir", "FLAG_download_tmp_dir"} {
if v, ok := c.environ.Get(f); ok {
return v
}