File tree Expand file tree Collapse file tree 1 file changed +23
-24
lines changed Expand file tree Collapse file tree 1 file changed +23
-24
lines changed Original file line number Diff line number Diff line change @@ -33,36 +33,35 @@ package main
33
33
import (
34
34
" context"
35
35
" fmt"
36
-
37
- " github.com/linode/linodego"
38
- " golang.org/x/oauth2"
39
-
40
36
" log"
41
37
" net/http"
42
38
" os"
39
+
40
+ " github.com/linode/linodego"
41
+ " golang.org/x/oauth2"
43
42
)
44
43
45
44
func main () {
46
- apiKey , ok := os.LookupEnv (" LINODE_TOKEN" )
47
- if !ok {
48
- log.Fatal (" Could not find LINODE_TOKEN, please assert it is set." )
49
- }
50
- tokenSource := oauth2.StaticTokenSource (&oauth2.Token {AccessToken: apiKey})
51
-
52
- oauth2Client := &http.Client {
53
- Transport: &oauth2.Transport {
54
- Source: tokenSource,
55
- },
56
- }
57
-
58
- linodeClient := linodego.NewClient (oauth2Client)
59
- linodeClient.SetDebug (true )
60
-
61
- res , err := linodeClient.GetInstance (context.Background (), 4090913 )
62
- if err != nil {
63
- log.Fatal (err)
64
- }
65
- fmt.Printf (" %v " , res)
45
+ apiKey , ok := os.LookupEnv (" LINODE_TOKEN" )
46
+ if !ok {
47
+ log.Fatal (" Could not find LINODE_TOKEN, please assert it is set." )
48
+ }
49
+ tokenSource := oauth2.StaticTokenSource (&oauth2.Token {AccessToken: apiKey})
50
+
51
+ oauth2Client := &http.Client {
52
+ Transport: &oauth2.Transport {
53
+ Source: tokenSource,
54
+ },
55
+ }
56
+
57
+ linodeClient := linodego.NewClient (oauth2Client)
58
+ linodeClient.SetDebug (true )
59
+
60
+ res , err := linodeClient.GetInstance (context.Background (), 4090913 )
61
+ if err != nil {
62
+ log.Fatal (err)
63
+ }
64
+ fmt.Printf (" %v " , res)
66
65
}
67
66
```
68
67
You can’t perform that action at this time.
0 commit comments