Skip to content

Commit

Permalink
chore: added error check to some functions (#223)
Browse files Browse the repository at this point in the history
* chore: run go mod tidy

* fix: added error check
  • Loading branch information
ponkio-o authored Jun 19, 2024
1 parent 48e03db commit 2ae15cc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 0 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,6 @@ github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/signalsciences/go-sigsci v0.1.19 h1:PV826ftNXvVjV+VW2kQegCWcK+sQ5FUlJvPlifcOyNk=
github.com/signalsciences/go-sigsci v0.1.19/go.mod h1:CXwoXk81ZwFdne6o8cnAYwxvke5kcLg7zE6Bl/e1KUo=
github.com/signalsciences/go-sigsci v0.1.20 h1:lMirioZwNWhnizOqryzvr1dsvOpmOn2e4MK+XEzlXrA=
github.com/signalsciences/go-sigsci v0.1.20/go.mod h1:CXwoXk81ZwFdne6o8cnAYwxvke5kcLg7zE6Bl/e1KUo=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
Expand Down Expand Up @@ -421,7 +419,6 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc
golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
Expand Down
5 changes: 4 additions & 1 deletion provider/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,10 @@ var siteImporter = schema.ResourceImporter{
if err != nil {
return nil, err
}
d.Set("site_short_name", site)
err = d.Set("site_short_name", site)
if err != nil {
return nil, err
}
d.SetId(id)
return []*schema.ResourceData{d}, nil
},
Expand Down
5 changes: 4 additions & 1 deletion provider/resource_site.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ func resourceSite() *schema.Resource {
Delete: deleteSite,
Importer: &schema.ResourceImporter{
State: func(d *schema.ResourceData, i interface{}) ([]*schema.ResourceData, error) {
d.Set("short_name", d.Id())
err := d.Set("short_name", d.Id())
if err != nil {
return nil, err
}
d.SetId(d.Id())
return []*schema.ResourceData{d}, nil
},
Expand Down

0 comments on commit 2ae15cc

Please sign in to comment.