Skip to content

Commit

Permalink
Update to Go 1.15
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Aug 15, 2020
1 parent f3cb0be commit e2a4d53
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defaults: &defaults
docker:
- image: bepsays/ci-goreleaser:1.14.3
- image: bepsays/ci-goreleaser:1.15.0
environment:
CGO_ENABLED: "0"

Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ env:
git:
depth: false
go:
- "1.13.11"
- "1.14.3"
- "1.14.7"
- "1.15"
- master

arch:
Expand Down
17 changes: 12 additions & 5 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ func init() {

// Build hugo binary
func Hugo() error {
return sh.RunWith(flagEnv(), goexe, "build", "-ldflags", ldflags, "-tags", buildTags(), packageName)
return sh.RunWith(flagEnv(), goexe, "build", "-ldflags", ldflags, buildFlags(), "-tags", buildTags(), packageName)
}

// Build hugo binary with race detector enabled
func HugoRace() error {
return sh.RunWith(flagEnv(), goexe, "build", "-race", "-ldflags", ldflags, "-tags", buildTags(), packageName)
return sh.RunWith(flagEnv(), goexe, "build", "-race", "-ldflags", ldflags, buildFlags(), "-tags", buildTags(), packageName)
}

// Install hugo binary
func Install() error {
return sh.RunWith(flagEnv(), goexe, "install", "-ldflags", ldflags, "-tags", buildTags(), packageName)
return sh.RunWith(flagEnv(), goexe, "install", "-ldflags", ldflags, buildFlags(), "-tags", buildTags(), packageName)
}

// Uninstall hugo binary
Expand Down Expand Up @@ -176,13 +176,13 @@ func Test386() error {
// Run tests
func Test() error {
env := map[string]string{"GOFLAGS": testGoFlags()}
return runCmd(env, goexe, "test", "./...", "-tags", buildTags())
return runCmd(env, goexe, "test", "./...", buildFlags(), "-tags", buildTags())
}

// Run tests with race detector
func TestRace() error {
env := map[string]string{"GOFLAGS": testGoFlags()}
return runCmd(env, goexe, "test", "-race", "./...", "-tags", buildTags())
return runCmd(env, goexe, "test", "-race", "./...", buildFlags(), "-tags", buildTags())
}

// Run gofmt linter
Expand Down Expand Up @@ -338,6 +338,13 @@ func isCI() bool {
return os.Getenv("CI") != ""
}

func buildFlags() string {
if runtime.GOOS == "windows" {
return "-buildmode exe"
}
return ""
}

func buildTags() string {
// To build the extended Hugo SCSS/SASS enabled version, build with
// HUGO_BUILD_TAGS=extended mage install etc.
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ parts:

hugo:
plugin: nil
build-snaps: [go/1.14/stable]
build-snaps: [go/1.15/stable]
source: .
override-build: |
set -ex
Expand Down

0 comments on commit e2a4d53

Please sign in to comment.