Skip to content

Commit e044410

Browse files
committed
Use tools.go to ensure we keep necessary dependencies
1 parent 08a697a commit e044410

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

main.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ package main
44
import (
55
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin"
66
"github.com/petoju/terraform-provider-mysql/v3/mysql"
7-
// Added to ensure we have tfplugindocs available in go.mod
8-
_ "github.com/hashicorp/terraform-plugin-docs"
97
)
108

119
func main() {

tools.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//go:build tools
2+
3+
/*
4+
Used for keeping ftplugindocs in the go.mod when using go mod tidy
5+
and used as go:generate
6+
Recommended approach per: https://github.com/golang/go/issues/25922#issuecomment-413898264
7+
*/
8+
package main
9+
10+
import (
11+
_ "github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs"
12+
)

0 commit comments

Comments
 (0)