From 682770bf8eef5cde64c9ef79718b3f20361cd769 Mon Sep 17 00:00:00 2001 From: Sahil Dua Date: Wed, 22 Nov 2017 22:48:30 +0100 Subject: [PATCH] gen-accessors: fix list of blacklisted structs and fields - Remove "service" from list of blacklisted fields because that was a mistake in the previous commit. - Add "service" to list of blacklisted structs because it would make more sense to not generate accessors for its fields. - Remove all debug printf statements. --- github/gen-accessors.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/github/gen-accessors.go b/github/gen-accessors.go index c8c6bb69463..4afe08388e2 100644 --- a/github/gen-accessors.go +++ b/github/gen-accessors.go @@ -49,13 +49,13 @@ var ( // this blacklist lists structs for which we don't want to generate // accessors. blacklistStruct = map[string]bool{ - "Client": true, + "Client": true, + "service": true, } // this blacklist lists fields for which we don't want to generate // accessors. blacklistField = map[string]bool{ "client": true, - "service": true, } ) @@ -119,19 +119,16 @@ func (t *templateData) processAST(f *ast.File) error { fieldName := field.Names[0] // check in blacklist if the ts.Name struct is blacklisted if key := fmt.Sprintf("%v", ts.Name); blacklistStruct[key] { - fmt.Printf("Struct %v blacklisted; skipping.\n", key) logf("Struct %v blacklisted; skipping.", key) continue } // check in blacklist if the field is blacklisted if key := fmt.Sprintf("%v", fieldName); blacklistField[key] { - fmt.Printf("Field %v is blacklisted; skipping.\n", key) logf("Field %v is blacklisted; skipping.", key) continue } // check for "struct.method" in blacklist if key := fmt.Sprintf("%v.Get%v", ts.Name, fieldName); blacklistStructMethod[key] { - fmt.Printf("%+v\n", key) logf("Method %v blacklisted; skipping.", key) continue }