Skip to content

Commit

Permalink
Upgrade to Go 1.23 (#226)
Browse files Browse the repository at this point in the history
* Upgrade to Go 1.23

* *

* Bump golangci-lint, fix new errors

* goreleaser deprecations
  • Loading branch information
ofalvai authored Jan 20, 2025
1 parent abf8e23 commit 7e737fe
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version: 2

before:
hooks:
- go mod tidy
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
golang 1.21
golang 1.23.5
15 changes: 13 additions & 2 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ app:
envs:
- BIN_NAME: envman

step_bundles:
setup-go:
steps:
- script:
title: Setup pinned Go version
inputs:
- content: asdf install

workflows:
test:
after_run:
- run_integration_tests
title: Runs tests
steps:
- bundle::setup-go: {}
- go-list: { }
- script:
title: golangci-lint
Expand All @@ -20,7 +29,7 @@ workflows:
#!/usr/bin/env bash
set -ex
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.57.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.62.2
asdf reshim golang
golangci-lint run
- go-test: { }
Expand Down Expand Up @@ -51,6 +60,7 @@ workflows:
envs:
- GITHUB_TOKEN: $GIT_BOT_USER_ACCESS_TOKEN # Goreleaser expects this env var
steps:
- bundle::setup-go: {}
- script:
title: Goreleaser (create binaries + publish to GH)
deps:
Expand All @@ -66,6 +76,7 @@ workflows:
test-binary-build:
description: Tests the release build process by creating a snapshot release (without publishing)
steps:
- bundle::setup-go: {}
- script:
title: Goreleaser (create snapshot binaries)
deps:
Expand All @@ -76,4 +87,4 @@ workflows:
#!/usr/bin/env bash
set -ex
goreleaser release --snapshot --rm-dist
goreleaser release --snapshot --clean
2 changes: 1 addition & 1 deletion cli/clear.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/urfave/cli"
)

func clear(_ *cli.Context) error {
func clearEnvstore(_ *cli.Context) error {
log.Debugln("[ENVMAN] - Work path:", CurrentEnvStoreFilePath)

if err := ClearEnvs(CurrentEnvStoreFilePath); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var (
Name: "clear",
Aliases: []string{"c"},
Usage: "Clear the envstore.",
Action: clear,
Action: clearEnvstore,
},
{
Name: "print",
Expand Down
8 changes: 4 additions & 4 deletions cli/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import (

func initEnvStore(c *cli.Context) error {
log.Debugln("[ENVMAN] - Work path:", CurrentEnvStoreFilePath)
clear := c.Bool(ClearKey)
err := InitEnvStore(CurrentEnvStoreFilePath, clear)
clearEnvstore := c.Bool(ClearKey)
err := InitEnvStore(CurrentEnvStoreFilePath, clearEnvstore)
log.Debugln("[ENVMAN] - Initialized")
return err
}

// InitEnvStore ...
func InitEnvStore(envStorePth string, clear bool) error {
if clear {
func InitEnvStore(envStorePth string, clearEnvstore bool) error {
if clearEnvstore {
if err := command.RemoveFile(envStorePth); err != nil {
return fmt.Errorf("failed to clear path: %s", err)
}
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/bitrise-io/envman

go 1.21
go 1.23

require (
github.com/bitrise-io/go-utils v1.0.13
Expand Down

0 comments on commit 7e737fe

Please sign in to comment.