Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sa7mon committed Dec 30, 2024
1 parent 3de171f commit 71ee726
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 91 deletions.
90 changes: 1 addition & 89 deletions cmd/regioncheck/wasabi.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,94 +7,6 @@ import (
"strings"
)

type nextData struct {
Props struct {
PageProps struct {
Story struct {
Name string `json:"name"`
Content struct {
Body []struct {
ID string `json:"id"`
UID string `json:"_uid"`
Title string `json:"Title"`
Width string `json:"width"`
Columns []struct {
Components []struct {
UID string `json:"_uid"`
Buttons []struct {
UID string `json:"_uid"`
Icon string `json:"icon"`
Link struct {
ID string `json:"id"`
URL string `json:"url"`
Linktype string `json:"linktype"`
Fieldtype string `json:"fieldtype"`
CachedURL string `json:"cached_url"`
Story struct {
Name string `json:"name"`
ID int `json:"id"`
UUID string `json:"uuid"`
Slug string `json:"slug"`
URL string `json:"url"`
FullSlug string `json:"full_slug"`
StopResolving bool `json:"_stopResolving"`
} `json:"story"`
} `json:"link"`
Type string `json:"type"`
Color string `json:"color"`
Label string `json:"label"`
Component string `json:"component"`
IconAlign string `json:"iconAlign"`
} `json:"buttons"`
Component string `json:"component"`
ParagraphText struct {
Type string `json:"type"`
Content []struct {
Type string `json:"type"`
Content []struct {
Text string `json:"text"`
Type string `json:"type"`
} `json:"content"`
} `json:"content"`
} `json:"paragraphText"`
} `json:"components"`
CustomColor struct {
Value string `json:"value"`
Plugin string `json:"plugin"`
} `json:"customColor"`
VerticalAlign string `json:"verticalAlign"`
BackgroundColor string `json:"backgroundColor"`
BackgroundPosition string `json:"backgroundPosition"`
} `json:"columns"`
Component string `json:"component"`
} `json:"body"`
} `json:"content"`
Slug string `json:"slug"`
Alternates []struct {
ID int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Published bool `json:"published"`
FullSlug string `json:"full_slug"`
IsFolder bool `json:"is_folder"`
ParentID int `json:"parent_id"`
} `json:"alternates"`
DefaultFullSlug any `json:"default_full_slug"`
TranslatedSlugs any `json:"translated_slugs"`
} `json:"story"`
Key int `json:"key"`
Locale string `json:"locale"`
Name string `json:"name"`
Sidebar bool `json:"sidebar"`
} `json:"pageProps"`
NSsg bool `json:"__N_SSG"`
} `json:"props"`
Page string `json:"page"`
Query struct {
Slug []string `json:"slug"`
} `json:"query"`
}

func getRegionsWasabi() ([]string, error) {
requestURL := "https://wasabi.com/company/storage-regions"
res, err := http.Get(requestURL)
Expand All @@ -112,7 +24,7 @@ func getRegionsWasabi() ([]string, error) {
}

regions := []string{}
doc.Find("main h3~p:has(b)").Contents().Each(func(i int, t *goquery.Selection) {
doc.Find("main h3~p:has(b)").Contents().Each(func(_ int, t *goquery.Selection) {
if goquery.NodeName(t) == "#text" {
rangeNames := strings.Split(t.Text(), "&")
for _, r := range rangeNames {
Expand Down
2 changes: 1 addition & 1 deletion provider/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func bucketExists301(client *s3.Client, region string, b *bucket.Bucket) (bool,
case 404:
return false, "", nil
}
return false, "", logErr(logFields, errors.New(fmt.Sprintf("unexpected status code: %d", res.StatusCode)))
return false, "", logErr(logFields, fmt.Errorf("unexpected status code: %d", res.StatusCode))
}

func logErr(fields log.Fields, err error) error {
Expand Down
2 changes: 1 addition & 1 deletion provider/wasabi.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (w *Wasabi) getRegionClient(region string) *s3.Client {

func (w *Wasabi) newExistsClient() (*s3.Client, error) {
client := &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error { // don't follow redirects
CheckRedirect: func(_ *http.Request, _ []*http.Request) error { // don't follow redirects
return http.ErrUseLastResponse
},
Transport: &http.Transport{
Expand Down

0 comments on commit 71ee726

Please sign in to comment.