1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-24 04:16:27 +02:00

style: improved code a bit

This commit is contained in:
Carlos Alexandro Becker 2018-02-03 00:16:30 -02:00 committed by Carlos Alexandro Becker
parent 5bc64413de
commit f3910c9751
2 changed files with 15 additions and 14 deletions

View File

@ -194,6 +194,7 @@ type Changelog struct {
Sort string `yaml:",omitempty"` Sort string `yaml:",omitempty"`
} }
// EnvFile is the
type EnvFiles struct { type EnvFiles struct {
GitHubToken string `yaml:"github_token,omitempty"` GitHubToken string `yaml:"github_token,omitempty"`
} }

8
pipeline/env/env.go vendored
View File

@ -52,7 +52,9 @@ func (Pipe) Run(ctx *context.Context) error {
func loadEnv(env, path string) (string, error) { func loadEnv(env, path string) (string, error) {
val := os.Getenv(env) val := os.Getenv(env)
if val == "" { if val != "" {
return val, nil
}
path, err := homedir.Expand(path) path, err := homedir.Expand(path)
if err != nil { if err != nil {
return "", err return "", err
@ -64,7 +66,5 @@ func loadEnv(env, path string) (string, error) {
if err != nil { if err != nil {
return "", err return "", err
} }
val = string(bts) return string(bts), nil
}
return val, nil
} }