diff --git a/go.mod b/go.mod index bc61644c2..90436c2c8 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/atc0005/go-teams-notify/v2 v2.10.0 github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20231024185945-8841054dbdb8 github.com/caarlos0/ctrlc v1.2.0 - github.com/caarlos0/env/v9 v9.0.0 + github.com/caarlos0/env/v11 v11.0.0 github.com/caarlos0/go-reddit/v3 v3.0.1 github.com/caarlos0/go-shellwords v1.0.12 github.com/caarlos0/go-version v0.1.1 diff --git a/go.sum b/go.sum index d844c5e1f..7bf7a8f2c 100644 --- a/go.sum +++ b/go.sum @@ -165,8 +165,8 @@ github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx2 github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/caarlos0/ctrlc v1.2.0 h1:AtbThhmbeYx1WW3WXdWrd94EHKi+0NPRGS4/4pzrjwk= github.com/caarlos0/ctrlc v1.2.0/go.mod h1:n3gDlSjsXZ7rbD9/RprIR040b7oaLfNStikPd4gFago= -github.com/caarlos0/env/v9 v9.0.0 h1:SI6JNsOA+y5gj9njpgybykATIylrRMklbs5ch6wO6pc= -github.com/caarlos0/env/v9 v9.0.0/go.mod h1:ye5mlCVMYh6tZ+vCgrs/B95sj88cg5Tlnc0XIzgZ020= +github.com/caarlos0/env/v11 v11.0.0 h1:ZIlkOjuL3xoZS0kmUJlF74j2Qj8GMOq3CDLX/Viak8Q= +github.com/caarlos0/env/v11 v11.0.0/go.mod h1:2RC3HQu8BQqtEK3V4iHPxj0jOdWdbPpWJ6pOueeU1xM= github.com/caarlos0/go-reddit/v3 v3.0.1 h1:w8ugvsrHhaE/m4ez0BO/sTBOBWI9WZTjG7VTecHnql4= github.com/caarlos0/go-reddit/v3 v3.0.1/go.mod h1:QlwgmG5SAqxMeQvg/A2dD1x9cIZCO56BMnMdjXLoisI= github.com/caarlos0/go-rpmutils v0.2.1-0.20240105125627-01185134a559 h1:5TPRjT2njvPKzXUcrcg6Dt+JPzQF+M5K7xb5V1Nwteg= diff --git a/internal/pipe/discord/discord.go b/internal/pipe/discord/discord.go index ee1e66cfd..daa5bd3f0 100644 --- a/internal/pipe/discord/discord.go +++ b/internal/pipe/discord/discord.go @@ -8,7 +8,7 @@ import ( "net/url" "strconv" - "github.com/caarlos0/env/v9" + "github.com/caarlos0/env/v11" "github.com/caarlos0/log" "github.com/goreleaser/goreleaser/internal/tmpl" "github.com/goreleaser/goreleaser/pkg/context" @@ -53,8 +53,8 @@ func (p Pipe) Announce(ctx *context.Context) error { return fmt.Errorf("discord: %w", err) } - var cfg Config - if err = env.Parse(&cfg); err != nil { + cfg, err := env.ParseAs[Config]() + if err != nil { return fmt.Errorf("discord: %w", err) } diff --git a/internal/pipe/linkedin/linkedin.go b/internal/pipe/linkedin/linkedin.go index 7b4894728..d36287672 100644 --- a/internal/pipe/linkedin/linkedin.go +++ b/internal/pipe/linkedin/linkedin.go @@ -3,7 +3,7 @@ package linkedin import ( "fmt" - "github.com/caarlos0/env/v9" + "github.com/caarlos0/env/v11" "github.com/caarlos0/log" "github.com/goreleaser/goreleaser/internal/tmpl" "github.com/goreleaser/goreleaser/pkg/context" @@ -34,8 +34,8 @@ func (Pipe) Announce(ctx *context.Context) error { return fmt.Errorf("linkedin: %w", err) } - var cfg Config - if err := env.Parse(&cfg); err != nil { + cfg, err := env.ParseAs[Config]() + if err != nil { return fmt.Errorf("linkedin: %w", err) } diff --git a/internal/pipe/mastodon/mastodon.go b/internal/pipe/mastodon/mastodon.go index 85c42a02c..c6bad09c9 100644 --- a/internal/pipe/mastodon/mastodon.go +++ b/internal/pipe/mastodon/mastodon.go @@ -3,7 +3,7 @@ package mastodon import ( "fmt" - "github.com/caarlos0/env/v9" + "github.com/caarlos0/env/v11" "github.com/caarlos0/log" "github.com/goreleaser/goreleaser/internal/tmpl" "github.com/goreleaser/goreleaser/pkg/context" @@ -39,8 +39,8 @@ func (Pipe) Announce(ctx *context.Context) error { return fmt.Errorf("mastodon: %w", err) } - var cfg Config - if err := env.Parse(&cfg); err != nil { + cfg, err := env.ParseAs[Config]() + if err != nil { return fmt.Errorf("mastodon: %w", err) } diff --git a/internal/pipe/mattermost/mattermost.go b/internal/pipe/mattermost/mattermost.go index 92ddaa317..e7b6b3b80 100644 --- a/internal/pipe/mattermost/mattermost.go +++ b/internal/pipe/mattermost/mattermost.go @@ -7,7 +7,7 @@ import ( "io" "net/http" - "github.com/caarlos0/env/v9" + "github.com/caarlos0/env/v11" "github.com/caarlos0/log" "github.com/goreleaser/goreleaser/internal/tmpl" @@ -59,8 +59,8 @@ func (Pipe) Announce(ctx *context.Context) error { return fmt.Errorf("teams: %w", err) } - var cfg Config - if err := env.Parse(&cfg); err != nil { + cfg, err := env.ParseAs[Config]() + if err != nil { return fmt.Errorf("mattermost: %w", err) } diff --git a/internal/pipe/opencollective/opencollective.go b/internal/pipe/opencollective/opencollective.go index 87ffb466e..9a396aa97 100644 --- a/internal/pipe/opencollective/opencollective.go +++ b/internal/pipe/opencollective/opencollective.go @@ -6,7 +6,7 @@ import ( "fmt" "net/http" - "github.com/caarlos0/env/v9" + "github.com/caarlos0/env/v11" "github.com/caarlos0/log" "github.com/goreleaser/goreleaser/internal/tmpl" "github.com/goreleaser/goreleaser/pkg/context" @@ -50,8 +50,8 @@ func (Pipe) Announce(ctx *context.Context) error { return fmt.Errorf("opencollective: %w", err) } - var cfg Config - if err := env.Parse(&cfg); err != nil { + cfg, err := env.ParseAs[Config]() + if err != nil { return fmt.Errorf("opencollective: %w", err) } diff --git a/internal/pipe/reddit/reddit.go b/internal/pipe/reddit/reddit.go index 9990aee20..19aed139e 100644 --- a/internal/pipe/reddit/reddit.go +++ b/internal/pipe/reddit/reddit.go @@ -3,7 +3,7 @@ package reddit import ( "fmt" - "github.com/caarlos0/env/v9" + "github.com/caarlos0/env/v11" "github.com/caarlos0/go-reddit/v3/reddit" "github.com/caarlos0/log" "github.com/goreleaser/goreleaser/internal/tmpl" @@ -54,8 +54,8 @@ func (Pipe) Announce(ctx *context.Context) error { URL: url, } - var cfg Config - if err := env.Parse(&cfg); err != nil { + cfg, err := env.ParseAs[Config]() + if err != nil { return fmt.Errorf("reddit: %w", err) } diff --git a/internal/pipe/slack/slack.go b/internal/pipe/slack/slack.go index fd17ba790..a12be3e95 100644 --- a/internal/pipe/slack/slack.go +++ b/internal/pipe/slack/slack.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/caarlos0/env/v9" + "github.com/caarlos0/env/v11" "github.com/caarlos0/log" "github.com/goreleaser/goreleaser/internal/tmpl" "github.com/goreleaser/goreleaser/pkg/context" @@ -42,8 +42,8 @@ func (Pipe) Announce(ctx *context.Context) error { return fmt.Errorf("slack: %w", err) } - var cfg Config - if err := env.Parse(&cfg); err != nil { + cfg, err := env.ParseAs[Config]() + if err != nil { return fmt.Errorf("slack: %w", err) } diff --git a/internal/pipe/smtp/smtp.go b/internal/pipe/smtp/smtp.go index 4322883ce..314d0251d 100644 --- a/internal/pipe/smtp/smtp.go +++ b/internal/pipe/smtp/smtp.go @@ -4,7 +4,7 @@ import ( "crypto/tls" "fmt" - "github.com/caarlos0/env/v9" + "github.com/caarlos0/env/v11" "github.com/caarlos0/log" "github.com/goreleaser/goreleaser/internal/tmpl" "github.com/goreleaser/goreleaser/pkg/config" diff --git a/internal/pipe/teams/teams.go b/internal/pipe/teams/teams.go index e56d4107c..27aeb7c58 100644 --- a/internal/pipe/teams/teams.go +++ b/internal/pipe/teams/teams.go @@ -5,7 +5,7 @@ import ( goteamsnotify "github.com/atc0005/go-teams-notify/v2" "github.com/atc0005/go-teams-notify/v2/messagecard" - "github.com/caarlos0/env/v9" + "github.com/caarlos0/env/v11" "github.com/caarlos0/log" "github.com/goreleaser/goreleaser/internal/tmpl" "github.com/goreleaser/goreleaser/pkg/context" @@ -54,8 +54,8 @@ func (p Pipe) Announce(ctx *context.Context) error { return fmt.Errorf("teams: %w", err) } - var cfg Config - if err := env.Parse(&cfg); err != nil { + cfg, err := env.ParseAs[Config]() + if err != nil { return fmt.Errorf("teams: %w", err) } diff --git a/internal/pipe/telegram/telegram.go b/internal/pipe/telegram/telegram.go index bf7c1f608..00157d0cd 100644 --- a/internal/pipe/telegram/telegram.go +++ b/internal/pipe/telegram/telegram.go @@ -4,7 +4,7 @@ import ( "fmt" "strconv" - "github.com/caarlos0/env/v9" + "github.com/caarlos0/env/v11" "github.com/caarlos0/log" api "github.com/go-telegram-bot-api/telegram-bot-api" "github.com/goreleaser/goreleaser/internal/tmpl" @@ -45,8 +45,8 @@ func (Pipe) Announce(ctx *context.Context) error { return err } - var cfg Config - if err := env.Parse(&cfg); err != nil { + cfg, err := env.ParseAs[Config]() + if err != nil { return fmt.Errorf("telegram: %w", err) } diff --git a/internal/pipe/twitter/twitter.go b/internal/pipe/twitter/twitter.go index 8b5dcf5d8..239b9624f 100644 --- a/internal/pipe/twitter/twitter.go +++ b/internal/pipe/twitter/twitter.go @@ -3,7 +3,7 @@ package twitter import ( "fmt" - "github.com/caarlos0/env/v9" + "github.com/caarlos0/env/v11" "github.com/caarlos0/log" "github.com/dghubble/go-twitter/twitter" "github.com/dghubble/oauth1" @@ -38,8 +38,8 @@ func (Pipe) Announce(ctx *context.Context) error { return fmt.Errorf("twitter: %w", err) } - var cfg Config - if err := env.Parse(&cfg); err != nil { + cfg, err := env.ParseAs[Config]() + if err != nil { return fmt.Errorf("twitter: %w", err) } diff --git a/internal/pipe/webhook/webhook.go b/internal/pipe/webhook/webhook.go index aad4533f3..da02227c0 100644 --- a/internal/pipe/webhook/webhook.go +++ b/internal/pipe/webhook/webhook.go @@ -9,7 +9,7 @@ import ( "net/url" "strings" - "github.com/caarlos0/env/v9" + "github.com/caarlos0/env/v11" "github.com/caarlos0/log" "github.com/goreleaser/goreleaser/internal/tmpl" "github.com/goreleaser/goreleaser/pkg/context" @@ -45,8 +45,8 @@ func (p Pipe) Default(ctx *context.Context) error { } func (p Pipe) Announce(ctx *context.Context) error { - var cfg Config - if err := env.Parse(&cfg); err != nil { + cfg, err := env.ParseAs[Config]() + if err != nil { return fmt.Errorf("webhook: %w", err) }