Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/pr_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.20.x
# NOTE: Manage GitHub Actions cache https://github.com/fastly/cli/actions/caches
# This is useful if you need to clear the cache when a dependency doesn't update correctly.
- name: "Restore golang bin cache"
Expand Down Expand Up @@ -82,8 +82,8 @@ jobs:
needs: config
strategy:
matrix:
tinygo-version: [0.26.0]
go-version: [1.19.x]
tinygo-version: [0.27.0]
go-version: [1.20.x]
node-version: [18]
rust-toolchain: [stable]
platform: [ubuntu-latest, macos-latest, windows-latest]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tag_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: "Install Go"
uses: actions/setup-go@v3
with:
go-version: '1.19.x'
go-version: '1.20.x'
- name: "Set GOHOSTOS and GOHOSTARCH"
run: echo "GOHOSTOS=$(go env GOHOSTOS)" >> $GITHUB_ENV && echo "GOHOSTARCH=$(go env GOHOSTARCH)" >> $GITHUB_ENV
- name: "Install Rust"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/fastly/cli

go 1.19
go 1.20

require (
github.com/Masterminds/semver/v3 v3.2.0
Expand Down
13 changes: 6 additions & 7 deletions pkg/commands/compute/setup/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ package setup
import (
"fmt"
"io"
"math/rand"
"net/http"
"regexp"
"strings"
"time"

petname "github.com/dustinkirkland/golang-petname"
"github.com/fastly/cli/pkg/api"
Expand Down Expand Up @@ -165,17 +163,17 @@ func (d *Domains) createDomain(name string, attempt int) error {
Name: &name,
})
if err != nil {
if attempt > d.RetryLimit {
return fmt.Errorf("too many attempts")
}

// We have to stop the ticker so we can now prompt the user.
d.Spinner.StopFailMessage(msg)
spinErr := d.Spinner.StopFail()
if spinErr != nil {
return spinErr
}

if attempt > d.RetryLimit {
return fmt.Errorf("too many attempts")
}

if e, ok := err.(*fastly.HTTPError); ok {
if e.StatusCode == http.StatusBadRequest {
for _, he := range e.Errors {
Expand Down Expand Up @@ -216,6 +214,7 @@ func generateDomainName() string {
// IMPORTANT: go1.20 deprecates rand.Seed
// The global random number generator (RNG) is now automatically seeded.
// If not seeded, the same domain name is repeated on each run.
rand.Seed(time.Now().UnixNano())
// If reverting CLI compilation to using <go1.20 then add the following line:
// rand.Seed(time.Now().UnixNano())
return fmt.Sprintf("%s.%s", petname.Generate(3, "-"), defaultTopLevelDomain)
}