File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 "net/http"
99 "net/url"
1010 "os"
11-
12- "github.com/joho/godotenv"
1311)
1412
1513type Response struct {
@@ -52,6 +50,12 @@ type Coin struct {
5250
5351func FilterGetAll (number string ) []Coin {
5452
53+ err := os .Setenv ("API" , "be121144-22a4-4e82-a6a7-6607739fa91a" )
54+
55+ if err != nil {
56+ fmt .Println ("Error on env variable!!!" )
57+ }
58+
5559 var response Response
5660
5761 client := & http.Client {}
@@ -100,6 +104,12 @@ func FilterGetAll(number string) []Coin {
100104
101105func GetAll () []Coin {
102106
107+ err := os .Setenv ("API" , "be121144-22a4-4e82-a6a7-6607739fa91a" )
108+
109+ if err != nil {
110+ fmt .Println ("Error on env variable!!!" )
111+ }
112+
103113 var response Response
104114
105115 client := & http.Client {}
@@ -148,10 +158,10 @@ func GetAll() []Coin {
148158
149159func GetCoin (coin string ) (Coin , error ) {
150160
151- err := godotenv . Load ( )
161+ err := os . Setenv ( "API" , "be121144-22a4-4e82-a6a7-6607739fa91a" )
152162
153163 if err != nil {
154- log . Fatal ("Error loading . env file " )
164+ fmt . Println ("Error on env variable!!! " )
155165 }
156166
157167 var response Response
Original file line number Diff line number Diff line change 44
55require (
66 github.com/fatih/color v1.16.0
7- github.com/joho/godotenv v1.5.1
87 github.com/rodaine/table v1.1.0
98)
109
Original file line number Diff line number Diff line change @@ -4,8 +4,6 @@ github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
44github.com/fatih/color v1.16.0 /go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE =
55github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38 =
66github.com/google/go-cmp v0.5.9 /go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY =
7- github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0 =
8- github.com/joho/godotenv v1.5.1 /go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4 =
97github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA =
108github.com/mattn/go-colorable v0.1.13 /go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg =
119github.com/mattn/go-isatty v0.0.16 /go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM =
You can’t perform that action at this time.
0 commit comments