Skip to content

Commit d1eb420

Browse files
SirGitsalotsahil-mahajan-googlewhaughtzli82016patrickmoy
authored
POC: Stop using goimports (#15267)
Signed-off-by: Matúš Bafrnec <[email protected]> Signed-off-by: Chris Henzie <[email protected]> Co-authored-by: sahil-mahajan-google <[email protected]> Co-authored-by: Weston Haught <[email protected]> Co-authored-by: Zhenhua Li <[email protected]> Co-authored-by: patrickmoy <[email protected]> Co-authored-by: Shuya Ma <[email protected]> Co-authored-by: Riley Karson <[email protected]> Co-authored-by: Ramon Vermeulen <[email protected]> Co-authored-by: Or Sela <[email protected]> Co-authored-by: sameer-google <[email protected]> Co-authored-by: Ryan Oaks <[email protected]> Co-authored-by: bryan0515 <[email protected]> Co-authored-by: tambalo-lgtm <[email protected]> Co-authored-by: Matheus Guilherme Souza Aleixo <[email protected]> Co-authored-by: Mauricio Alvarez Leon <[email protected]> Co-authored-by: Stephen Lewis (Burrows) <[email protected]> Co-authored-by: vishakhamodi-google <[email protected]> Co-authored-by: g-dreva <[email protected]> Co-authored-by: Betto Cerrillos <[email protected]> Co-authored-by: Stephen Lewis (Burrows) <[email protected]> Co-authored-by: shivangd <[email protected]> Co-authored-by: lychgoogle <[email protected]> Co-authored-by: Rajesh Guptha <[email protected]> Co-authored-by: chethangowda89 <[email protected]> Co-authored-by: Chethan Gowda <[email protected]> Co-authored-by: kefang2 <[email protected]> Co-authored-by: jlmwise <[email protected]> Co-authored-by: chengliwm <[email protected]> Co-authored-by: Luca Prete <[email protected]> Co-authored-by: Luca Prete <[email protected]> Co-authored-by: olmoods <[email protected]> Co-authored-by: wj-chen <[email protected]> Co-authored-by: Taneli Leppä <[email protected]> Co-authored-by: victorsantos-cit <[email protected]> Co-authored-by: Thomas Rodgers <[email protected]> Co-authored-by: Ben Hu <[email protected]> Co-authored-by: Ben Hu <[email protected]> Co-authored-by: malhotrasagar2212 <[email protected]> Co-authored-by: avinash patnala <[email protected]> Co-authored-by: Avinash Patnala <[email protected]> Co-authored-by: Björn <[email protected]> Co-authored-by: David Karwowski <[email protected]> Co-authored-by: dkarwowski <[email protected]> Co-authored-by: chayan kumar roy <[email protected]> Co-authored-by: jarek-dudek <[email protected]> Co-authored-by: Scott Suarez <[email protected]> Co-authored-by: Patrick Rauchfuss <[email protected]> Co-authored-by: olmoods <[email protected]> Co-authored-by: Huici Pan <[email protected]> Co-authored-by: Adarsh Kumar <[email protected]> Co-authored-by: adkr <[email protected]> Co-authored-by: siddhisingh-13 <[email protected]> Co-authored-by: bcreddy-gcp <[email protected]> Co-authored-by: Sachin_R <[email protected]> Co-authored-by: harshithpatte-g <[email protected]> Co-authored-by: NA2047 <[email protected]> Co-authored-by: anthonyrtong <[email protected]> Co-authored-by: Matúš Bafrnec <[email protected]> Co-authored-by: Ingmar Stein <[email protected]> Co-authored-by: Yuval Brik <[email protected]> Co-authored-by: Thoufic <[email protected]> Co-authored-by: Thoufic <[email protected]> Co-authored-by: Ankush Jain <[email protected]> Co-authored-by: Jesse DeJong <[email protected]> Co-authored-by: Nick Elliot <[email protected]> Co-authored-by: Ed Davisson <[email protected]> Co-authored-by: gurusai-voleti <[email protected]> Co-authored-by: ML <[email protected]> Co-authored-by: Marek Lipert <[email protected]> Co-authored-by: Krzysztof Kwietniewski <[email protected]> Co-authored-by: hemantadil <[email protected]> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Hemant Adil <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Bollen Nico <[email protected]> Co-authored-by: Daniel Dubnikov <[email protected]> Co-authored-by: Cory Hall <[email protected]> Co-authored-by: tongryan-google <[email protected]> Co-authored-by: Chris Henzie <[email protected]> Co-authored-by: Sam Levenick <[email protected]> Co-authored-by: jgforsberg <[email protected]> Co-authored-by: jkrish-c <[email protected]> Co-authored-by: Mehul3217 <[email protected]> Co-authored-by: Ricardo Fernández <[email protected]> Co-authored-by: piyush <[email protected]> Co-authored-by: Manan <[email protected]> Co-authored-by: Dominik Müller <[email protected]> Co-authored-by: Raj Anand <[email protected]> Co-authored-by: Andras Kerekes <[email protected]> Co-authored-by: maayanbeltzer <[email protected]> Co-authored-by: hao-nan-li <[email protected]>
1 parent 6fb2d30 commit d1eb420

40 files changed

+456
-139
lines changed

mmv1/products/bigtable/AppProfile.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ timeouts:
3535
update_minutes: 20
3636
delete_minutes: 20
3737
custom_code:
38+
constants: 'templates/terraform/constants/bigtable_app_profile_routing.go.tmpl'
3839
extra_schema_entry: 'templates/terraform/extra_schema_entry/bigtable_app_profile.go.tmpl'
3940
encoder: 'templates/terraform/encoders/bigtable_app_profile.go.tmpl'
4041
pre_update: 'templates/terraform/pre_update/bigtable_app_profile.go.tmpl'

mmv1/products/compute/NodeGroup.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ async:
3939
resource_inside_response: false
4040
collection_url_key: 'items'
4141
custom_code:
42+
constants: 'templates/terraform/constants/compute_node_group.go.tmpl'
4243
pre_create: 'templates/terraform/pre_create/compute_node_group_url_replace.go.tmpl'
4344
sweeper:
4445
url_substitutions:

mmv1/products/compute/RegionDisk.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ iam_policy:
5858
- 'projects/{{project}}/regions/{{region}}/disks/{{name}}'
5959
- '{{name}}'
6060
custom_code:
61+
constants: 'templates/terraform/constants/region_disk.go.tmpl'
6162
encoder: 'templates/terraform/encoders/disk.tmpl'
6263
decoder: 'templates/terraform/decoders/disk.tmpl'
6364
update_encoder: 'templates/terraform/update_encoder/hyper_disk.go.tmpl'

mmv1/products/compute/Reservation.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ async:
4646
resource_inside_response: false
4747
collection_url_key: 'items'
4848
custom_code:
49+
constants: 'templates/terraform/constants/reservation.go.tmpl'
4950
update_encoder: 'templates/terraform/update_encoder/reservation.go.tmpl'
5051
pre_update: 'templates/terraform/pre_update/shared_reservation_update.go.tmpl'
5152
sweeper:

mmv1/products/dns/ManagedZone.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ iam_policy:
3737
- 'projects/{{project}}/managedZones/{{managed_zone}}'
3838
- '{{project}}/{{managed_zone}}'
3939
custom_code:
40+
constants: 'templates/terraform/constants/managed_dns_zone.go.tmpl'
4041
update_encoder: 'templates/terraform/update_encoder/managed_dns_zone.go.tmpl'
4142
pre_delete: 'templates/terraform/pre_delete/managed_dns_zone.go.tmpl'
4243
examples:

mmv1/products/storage/Folder.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ references:
4343
'Official Documentation': 'https://cloud.google.com/storage/docs/folders-overview'
4444
api: 'https://cloud.google.com/storage/docs/json_api/v1/folders'
4545
custom_code:
46+
constants: templates/terraform/constants/storage_folder.go.tmpl
4647
custom_import: templates/terraform/custom_import/storage_folder.go.tmpl
4748
custom_update: templates/terraform/custom_update/storage_folder_update.go.tmpl
4849
custom_delete: templates/terraform/custom_delete/storage_folder_delete.go.tmpl

mmv1/provider/template_data.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,8 @@ func FixImports(outputPath string, dumpDiffs bool) {
318318
})
319319

320320
if hasFiles {
321-
cmd := exec.Command("goimports", args...)
321+
log.Printf("Fixing go import paths")
322+
cmd := exec.Command("echo", args...)
322323
cmd.Dir = outputPath
323324
cmd.Stdout = os.Stdout
324325
cmd.Stderr = os.Stderr
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import "google.golang.org/api/bigtableadmin/v2"

mmv1/templates/terraform/constants/compute_certificate.go.tmpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import (
2+
"crypto/sha256"
3+
"encoding/hex"
4+
)
5+
16
// sha256DiffSuppress
27
// if old is the hex-encoded sha256 sum of new, treat them as equal
38
func sha256DiffSuppress(_, old, new string, _ *schema.ResourceData) bool {

mmv1/templates/terraform/constants/compute_forwarding_rule.go.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import "net"
2+
13
func forwardingRuleCustomizeDiff(_ context.Context, diff *schema.ResourceDiff, v interface{}) error {
24
log.Println("[DEBUG] [PSC] Reached forwardingRuleCustomizeDiff function")
35

0 commit comments

Comments
 (0)