Skip to content

Commit

Permalink
feat: update workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
  • Loading branch information
caarlos0 committed Dec 23, 2021
1 parent babdce2 commit d6acbd9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/setup-go@v2
with:
go-version: ~1.17
- uses: actions/cache@v1
- uses: actions/cache@v
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
Expand All @@ -27,6 +27,6 @@ jobs:
- run: make setup
- run: make test
- run: git diff
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v2
with:
file: ./coverage.txt
2 changes: 1 addition & 1 deletion .github/workflows/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v2
- uses: dessant/lock-threads@v3
with:
github-token: ${{ github.token }}
issue-lock-inactive-days: 30
Expand Down
8 changes: 4 additions & 4 deletions internal/whois/whois.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,23 @@ func NewClient() client.Client {
}

func (c whoisClient) ExpireTime(ctx context.Context, domain string) (time.Time, error) {
log.Debug().Msgf("trying whois client for %s", domain)
log.Debug().Msgf("trying whois client for %q", domain)
body, err := c.request(ctx, domain, "")
if err != nil {
return time.Now(), err
}
result := expiryRE.FindStringSubmatch(body)
if len(result) < 2 {
return time.Now(), fmt.Errorf("could not parse whois response: %s", body)
return time.Now(), fmt.Errorf("could not parse whois response: %q", body)
}
dateStr := strings.TrimSpace(result[2])
for _, format := range formats {
if date, err := time.Parse(format, dateStr); err == nil {
log.Debug().Msgf("domain %s will expire at %s", domain, date.String())
log.Debug().Msgf("domain %q will expire at %q", domain, date.String())
return date, nil
}
}
return time.Now(), fmt.Errorf("could not parse date: %s", dateStr)
return time.Now(), fmt.Errorf("could not parse date: %q", dateStr)
}

func (c whoisClient) request(ctx context.Context, domain, host string) (string, error) {
Expand Down

0 comments on commit d6acbd9

Please sign in to comment.