Skip to content

Commit

Permalink
Merge pull request #5 from julienlevasseur/update-go-version
Browse files Browse the repository at this point in the history
feat: Update go version and deps
  • Loading branch information
julienlevasseur authored Oct 31, 2023
2 parents c56342c + 9db1f29 commit 23b9049
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 364 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
go-version: '>=1.20.1'
go-version: '>=1.21.3'
cache: true
-
name: Import GPG key
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Julien Levasseur
Copyright (c) 2023 Julien Levasseur

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
30 changes: 27 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
module github.com/julienlevasseur/terraform-provider-uname

go 1.13
go 1.21

require (
github.com/hashicorp/terraform-plugin-framework v1.1.1
github.com/hashicorp/terraform-plugin-sdk/v2 v2.25.0
github.com/hashicorp/terraform-plugin-framework v1.4.2
github.com/matishsiao/goInfo v0.0.0-20210923090445-da2e3fa8d45f
)

require (
github.com/fatih/color v1.13.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-plugin v1.5.1 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/terraform-plugin-go v0.19.0 // indirect
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
github.com/hashicorp/terraform-registry-address v0.2.2 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
google.golang.org/grpc v1.57.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
)
385 changes: 38 additions & 347 deletions go.sum

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ var (
_ provider.Provider = (*unameProvider)(nil)
)

type unameProvider struct{}
type unameProvider struct {
version string
}

func New() provider.Provider {
return &unameProvider{}
func New(version string) func() provider.Provider {
return func() provider.Provider {
return &unameProvider{
version: version,
}
}
}

func (p *unameProvider) Metadata(ctx context.Context, req provider.MetadataRequest, resp *provider.MetadataResponse) {
Expand Down
13 changes: 5 additions & 8 deletions internal/provider/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ package provider
import (
"testing"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-framework/providerserver"
"github.com/hashicorp/terraform-plugin-go/tfprotov6"
)

var testProviders = map[string]*schema.Provider{
"local": New(),
var testAccProtoV6ProviderFactories = map[string]func() (tfprotov6.ProviderServer, error){
"scaffolding": providerserver.NewProtocol6WithError(New("local")()),
}

func TestProvider(t *testing.T) {
if err := New().InternalValidate(); err != nil {
t.Fatal("err: %s", err)
}
}
func TestProvider(t *testing.T) {}
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ import (
"github.com/julienlevasseur/terraform-provider-uname/internal/provider"
)

var (
version string = "dev"
)

func main() {
err := providerserver.Serve(context.Background(), provider.New, providerserver.ServeOpts{
err := providerserver.Serve(context.Background(), provider.New(version), providerserver.ServeOpts{
Address: "registry.terraform.io/julienlevasseur/uname",
ProtocolVersion: 5,
})
Expand Down

0 comments on commit 23b9049

Please sign in to comment.