diff --git a/.golangci.yml b/.golangci.yml index 51d47ebb474..051d5e716f6 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -40,6 +40,8 @@ linters: comparison: true forbidigo: forbid: + - pattern: ^fmt\.Print.*$ + msg: "Do not use fmt.Print statements." - pattern: ^reflect\.DeepEqual$ msg: "Use cmp.Equal instead of reflect.DeepEqual" - pattern: "^http\\.Method[A-Z][a-z]*$" @@ -359,6 +361,11 @@ linters: - unparam path: _test\.go + # Allow fmt.Print in examples, internal tools, and tests. + - linters: [forbidigo] + path: ^(example|tools|test|scrape)\/ + text: 'fmt\.Print' + # We need to pass nil Context in order to test DoBare erroring on nil ctx. - linters: [staticcheck] path: _test\.go diff --git a/github/actions_variables_test.go b/github/actions_variables_test.go index 688a77beb07..1a47ede0de6 100644 --- a/github/actions_variables_test.go +++ b/github/actions_variables_test.go @@ -752,7 +752,5 @@ func TestActionVariable_Marshal(t *testing.T) { "selected_repository_ids": [1,2,3] }`, referenceTimeStr, referenceTimeStr) - fmt.Println(want) - testJSONMarshal(t, av, want) } diff --git a/github/enterprise_licenses_test.go b/github/enterprise_licenses_test.go index 422d28277c6..dd7e817abef 100644 --- a/github/enterprise_licenses_test.go +++ b/github/enterprise_licenses_test.go @@ -171,8 +171,6 @@ func TestEnterpriseService_GetLicenseSyncStatus(t *testing.T) { }, } - fmt.Printf("%v\n", cmp.Diff(want, syncStatus)) - if !cmp.Equal(syncStatus, want) { t.Errorf("Enterprise.GetLicenseSyncStatus returned %+v, want %+v", syncStatus, want) }