Skip to content

Commit

Permalink
Use module tpg in go.mod (GoogleCloudPlatform#8228)
Browse files Browse the repository at this point in the history
* Use module tpg in go.mod

* Remove comment
  • Loading branch information
zli82016 authored and DanielRieske committed Aug 2, 2023
1 parent 8027df1 commit 12dbf40
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 8 additions & 1 deletion mmv1/provider/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ def copy_file_list(output_folder, files)
FileUtils.copy_entry source, target_file

add_hashicorp_copyright_header(output_folder, target) if File.extname(target) == '.go'
replace_import_path(output_folder, target) if File.extname(target) == '.go'
if File.extname(target) == '.go' || File.extname(target) == '.mod'
replace_import_path(output_folder, target)
end
end
end.map(&:join)
end
Expand Down Expand Up @@ -306,6 +308,11 @@ def replace_import_path(output_folder, target)
"#{TERRAFORM_PROVIDER_GA}/version",
"#{tpg}/version"
)

data = data.gsub(
"module #{TERRAFORM_PROVIDER_GA}",
"module #{tpg}"
)
File.write("#{output_folder}/#{target}", data)
end

Expand Down
3 changes: 1 addition & 2 deletions mmv1/third_party/terraform/go.mod.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<% autogen_exception -%>
module github.com/hashicorp/terraform-provider-google<%= "-" + version unless version == 'ga' -%>

module github.com/hashicorp/terraform-provider-google
go 1.19

require (
Expand Down

0 comments on commit 12dbf40

Please sign in to comment.