Run gofmt on compliance
Test: builds
Change-Id: I404b138faac0db9a92201be6163b19d9e6bff810
diff --git a/tools/compliance/policy/policy.go b/tools/compliance/policy/policy.go
index 4261ed0..442025e 100644
--- a/tools/compliance/policy/policy.go
+++ b/tools/compliance/policy/policy.go
@@ -33,21 +33,21 @@
// proprietary or confidential pathnames to whether to strip the prefix
// from the path when used as the library name for notices.
SafePathPrefixes = map[string]bool{
- "external/": true,
- "art/": false,
- "build/": false,
- "cts/": false,
- "dalvik/": false,
- "developers/": false,
+ "external/": true,
+ "art/": false,
+ "build/": false,
+ "cts/": false,
+ "dalvik/": false,
+ "developers/": false,
"development/": false,
- "frameworks/": false,
- "packages/": true,
- "prebuilts/": false,
- "sdk/": false,
- "system/": false,
- "test/": false,
- "toolchain/": false,
- "tools/": false,
+ "frameworks/": false,
+ "packages/": true,
+ "prebuilts/": false,
+ "sdk/": false,
+ "system/": false,
+ "test/": false,
+ "toolchain/": false,
+ "tools/": false,
}
// SafePrebuiltPrefixes maps the regular expression to match a prebuilt
@@ -62,8 +62,8 @@
// ImpliesNotice lists the condition names implying a notice or attribution policy.
ImpliesNotice = LicenseConditionSet(UnencumberedCondition | PermissiveCondition | NoticeCondition | ReciprocalCondition |
- RestrictedCondition | RestrictedClasspathExceptionCondition | WeaklyRestrictedCondition |
- ProprietaryCondition | ByExceptionOnlyCondition)
+ RestrictedCondition | RestrictedClasspathExceptionCondition | WeaklyRestrictedCondition |
+ ProprietaryCondition | ByExceptionOnlyCondition)
// ImpliesReciprocal lists the condition names implying a local source-sharing policy.
ImpliesReciprocal = LicenseConditionSet(ReciprocalCondition)
@@ -143,7 +143,6 @@
return cs
}
-
// Resolution happens in three phases:
//
// 1. A bottom-up traversal propagates (restricted) license conditions up to
@@ -182,7 +181,6 @@
// Not all restricted licenses are create equal. Some have special rules or
// exceptions. e.g. LGPL or "with classpath excption".
-
// depConditionsPropagatingToTarget returns the conditions which propagate up an
// edge from dependency to target.
//
@@ -204,7 +202,7 @@
}
result |= depConditions & LicenseConditionSet(RestrictedCondition)
- if 0 != (depConditions & LicenseConditionSet(RestrictedClasspathExceptionCondition)) && !edgeNodesAreIndependentModules(e) {
+ if 0 != (depConditions&LicenseConditionSet(RestrictedClasspathExceptionCondition)) && !edgeNodesAreIndependentModules(e) {
result |= LicenseConditionSet(RestrictedClasspathExceptionCondition)
}
return result
@@ -264,13 +262,12 @@
}
result &= LicenseConditionSet(RestrictedCondition | RestrictedClasspathExceptionCondition)
- if 0 != (result & LicenseConditionSet(RestrictedClasspathExceptionCondition)) && edgeNodesAreIndependentModules(e) {
+ if 0 != (result&LicenseConditionSet(RestrictedClasspathExceptionCondition)) && edgeNodesAreIndependentModules(e) {
result &= LicenseConditionSet(RestrictedCondition)
}
return result
}
-
// edgeIsDynamicLink returns true for edges representing shared libraries
// linked dynamically at runtime.
func edgeIsDynamicLink(e *TargetEdge) bool {
diff --git a/tools/compliance/policy/shareprivacyconflicts_test.go b/tools/compliance/policy/shareprivacyconflicts_test.go
index ad3f3f4..2d2a1d0 100644
--- a/tools/compliance/policy/shareprivacyconflicts_test.go
+++ b/tools/compliance/policy/shareprivacyconflicts_test.go
@@ -24,7 +24,7 @@
type byConflict []SourceSharePrivacyConflict
// Len returns the count of elements in the slice.
-func (l byConflict) Len() int { return len(l) }
+func (l byConflict) Len() int { return len(l) }
// Swap rearranged 2 elements so that each occupies the other's former
// position.
diff --git a/tools/compliance/policy/shipped_test.go b/tools/compliance/policy/shipped_test.go
index 718e56f..25f6af0 100644
--- a/tools/compliance/policy/shipped_test.go
+++ b/tools/compliance/policy/shipped_test.go
@@ -29,30 +29,30 @@
expectedNodes []string
}{
{
- name: "singleton",
- roots: []string{"apacheLib.meta_lic"},
- edges: []annotated{},
+ name: "singleton",
+ roots: []string{"apacheLib.meta_lic"},
+ edges: []annotated{},
expectedNodes: []string{"apacheLib.meta_lic"},
},
{
- name: "simplebinary",
- roots: []string{"apacheBin.meta_lic"},
+ name: "simplebinary",
+ roots: []string{"apacheBin.meta_lic"},
edges: []annotated{
{"apacheBin.meta_lic", "apacheLib.meta_lic", []string{"static"}},
},
expectedNodes: []string{"apacheBin.meta_lic", "apacheLib.meta_lic"},
},
{
- name: "simpledynamic",
- roots: []string{"apacheBin.meta_lic"},
+ name: "simpledynamic",
+ roots: []string{"apacheBin.meta_lic"},
edges: []annotated{
{"apacheBin.meta_lic", "lgplLib.meta_lic", []string{"dynamic"}},
},
expectedNodes: []string{"apacheBin.meta_lic"},
},
{
- name: "container",
- roots: []string{"apacheContainer.meta_lic"},
+ name: "container",
+ roots: []string{"apacheContainer.meta_lic"},
edges: []annotated{
{"apacheContainer.meta_lic", "apacheLib.meta_lic", []string{"static"}},
{"apacheContainer.meta_lic", "gplLib.meta_lic", []string{"static"}},
@@ -64,8 +64,8 @@
},
},
{
- name: "binary",
- roots: []string{"apacheBin.meta_lic"},
+ name: "binary",
+ roots: []string{"apacheBin.meta_lic"},
edges: []annotated{
{"apacheBin.meta_lic", "apacheLib.meta_lic", []string{"static"}},
{"apacheBin.meta_lic", "gplLib.meta_lic", []string{"static"}},
@@ -77,8 +77,8 @@
},
},
{
- name: "binarydynamic",
- roots: []string{"apacheBin.meta_lic"},
+ name: "binarydynamic",
+ roots: []string{"apacheBin.meta_lic"},
edges: []annotated{
{"apacheBin.meta_lic", "apacheLib.meta_lic", []string{"static"}},
{"apacheBin.meta_lic", "gplLib.meta_lic", []string{"dynamic"}},
@@ -89,8 +89,8 @@
},
},
{
- name: "containerdeep",
- roots: []string{"apacheContainer.meta_lic"},
+ name: "containerdeep",
+ roots: []string{"apacheContainer.meta_lic"},
edges: []annotated{
{"apacheContainer.meta_lic", "apacheBin.meta_lic", []string{"static"}},
{"apacheBin.meta_lic", "apacheLib.meta_lic", []string{"static"}},
@@ -127,7 +127,7 @@
t.Logf("sorted nodes: [%s]", strings.Join(actualNodes, ", "))
t.Logf("expected nodes: [%s]", strings.Join(expectedNodes, ", "))
- if len(expectedNodes) != len(actualNodes) {
+ if len(expectedNodes) != len(actualNodes) {
t.Errorf("unexpected number of shipped nodes: %d nodes, want %d nodes",
len(actualNodes), len(expectedNodes))
return
diff --git a/tools/compliance/policy/walk.go b/tools/compliance/policy/walk.go
index 3e73088..f4d7bba 100644
--- a/tools/compliance/policy/walk.go
+++ b/tools/compliance/policy/walk.go
@@ -83,7 +83,7 @@
// specific set of conditions.
type resolutionKey struct {
target *TargetNode
- cs LicenseConditionSet
+ cs LicenseConditionSet
}
// WalkResolutionsForCondition performs a top-down walk of the LicenseGraph