@@ -2,21 +2,21 @@ package github
22
33import (
44 "context"
5- "errors"
6- "log"
5+ "fmt"
76 "net/http"
87 "strconv"
9- "strings"
108
119 "github.com/google/go-github/v82/github"
10+ "github.com/hashicorp/terraform-plugin-log/tflog"
11+ "github.com/hashicorp/terraform-plugin-sdk/v2/diag"
1212 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1313)
1414
1515func resourceGithubUserSshKey () * schema.Resource {
1616 return & schema.Resource {
17- Create : resourceGithubUserSshKeyCreate ,
18- Read : resourceGithubUserSshKeyRead ,
19- Delete : resourceGithubUserSshKeyDelete ,
17+ CreateContext : resourceGithubUserSshKeyCreate ,
18+ ReadContext : resourceGithubUserSshKeyRead ,
19+ DeleteContext : resourceGithubUserSshKeyDelete ,
2020 Importer : & schema.ResourceImporter {
2121 StateContext : resourceGithubUserSshKeyImport ,
2222 },
@@ -35,8 +35,8 @@ func resourceGithubUserSshKey() *schema.Resource {
3535 Description : "The public SSH key to add to your GitHub account." ,
3636 },
3737 "key_id" : {
38- Type : schema .TypeInt ,
39- Computed : true ,
38+ Type : schema .TypeInt ,
39+ Computed : true ,
4040 Description : "The unique identifier of the SSH key." ,
4141 },
4242 "etag" : {
@@ -83,7 +83,7 @@ func resourceGithubUserSshKeyRead(ctx context.Context, d *schema.ResourceData, m
8383 client := meta .(* Owner ).v3client
8484
8585 keyID := d .Get ("key_id" ).(int64 )
86- key , resp , err := client .Users .GetKey (ctx , keyID )
86+ _ , _ , err := client .Users .GetKey (ctx , keyID )
8787 if err != nil {
8888 if ghErr , ok := err .(* github.ErrorResponse ); ok {
8989 if ghErr .Response .StatusCode == http .StatusNotModified {
0 commit comments