* Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.10.1 to 2.11.0 Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.10.1 to 2.11.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.10.1...v2.11.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Add `setup-go` before `golangci-lint` Version 3 of `golangci/golangci-lint-action` requires explicit `setup-go` installation. * Use `ServeOpts` for debug mode Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Joshua Spence <josh@spence.com.au>
38 lines
901 B
Go
38 lines
901 B
Go
package main // import "github.com/paultyng/terraform-provider-unifi"
|
|
|
|
import (
|
|
"flag"
|
|
|
|
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin"
|
|
|
|
"github.com/paultyng/terraform-provider-unifi/internal/provider"
|
|
)
|
|
|
|
// Generate docs for website
|
|
//go:generate go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
|
|
|
|
var (
|
|
// these will be set by the goreleaser configuration
|
|
// to appropriate values for the compiled binary
|
|
version string = "dev"
|
|
|
|
// goreleaser can also pass the specific commit if you want
|
|
// commit string = ""
|
|
)
|
|
|
|
func main() {
|
|
var debugMode bool
|
|
|
|
flag.BoolVar(&debugMode, "debug", false, "set to true to run the provider with support for debuggers like delve")
|
|
flag.Parse()
|
|
|
|
opts := &plugin.ServeOpts{ProviderFunc: provider.New(version)}
|
|
|
|
if debugMode {
|
|
opts.Debug = true
|
|
opts.ProviderAddr = "registry.terraform.io/paultyng/unifi"
|
|
}
|
|
|
|
plugin.Serve(opts)
|
|
}
|