Skip to content

Commit

Permalink
fix(cache.go): fix call api.zonedetails failure #32
Browse files Browse the repository at this point in the history
Fixed cloudflare/cache.go incompatibility issues during action run

Error: internal/cloudflare/cache.go:24:31: not enough arguments in call to api.ZoneDetails
  • Loading branch information
andatoshiki committed Jun 19, 2022
1 parent 5e207e9 commit 56e6e6a
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions internal/cloudflare/cache.go
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
package cloudflare

// import (
// "fmt"
// "log"
import (
"fmt"
"log"

// "github.com/cloudflare/cloudflare-go"
// "github.com/andatoshiki/toshiki-proxypool/config"
// )
"github.com/cloudflare/cloudflare-go"
"github.com/andatoshiki/toshiki-proxypool/config"
)

// func test() {
// api, err := cloudflare.New(config.Config.CFKey, config.Config.CFKey)
// if err != nil {
// log.Fatal(err)
// }
func test() {
api, err := cloudflare.New(config.Config.CFKey, config.Config.CFKey)
if err != nil {
log.Fatal(err)
}

// // Fetch the zone ID
// id, err := api.ZoneIDByName(config.Config.Domain)
// if err != nil {
// log.Fatal(err)
// }
// Fetch the zone ID
id, err := api.ZoneIDByName(config.Config.Domain)
if err != nil {
log.Fatal(err)
}

// // Fetch zone details
// zone, err := api.ZoneDetails(id)
// if err != nil {
// log.Fatal(err)
// }
// // Print zone details
// fmt.Println(zone)
// }
// Fetch zone details
zone, err := api.ZoneDetails(context.Background(), id)
if err != nil {
log.Fatal(err)
}
// Print zone details
fmt.Println(zone)
}

0 comments on commit 56e6e6a

Please sign in to comment.