Skip to content

Commit e6be45d

Browse files
authored
Don't print a message every time config file is used (#34)
1 parent 803bf2d commit e6be45d

File tree

4 files changed

+23
-1277
lines changed

4 files changed

+23
-1277
lines changed

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Go
1919
uses: actions/setup-go@v4
2020
with:
21-
go-version: 1.17
21+
go-version-file: 'go.mod'
2222

2323
- name: Set up QEMU
2424
uses: docker/setup-qemu-action@v2

cmd/root.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ func initConfig() {
9797
viper.AutomaticEnv() // read in environment variables that match
9898

9999
// If a config file is found, read it in.
100-
if err := viper.ReadInConfig(); err == nil {
101-
fmt.Println("Using config file:", viper.ConfigFileUsed())
102-
}
100+
// Indicates viper.ConfigFileNotFoundError if no config file is provided, which is fine
101+
_ = viper.ReadInConfig()
103102
}

go.mod

+19-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,22 @@ require (
66
github.com/spf13/viper v1.16.0
77
)
88

9-
go 1.13
9+
require (
10+
github.com/fsnotify/fsnotify v1.6.0 // indirect
11+
github.com/hashicorp/hcl v1.0.0 // indirect
12+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
13+
github.com/magiconair/properties v1.8.7 // indirect
14+
github.com/mitchellh/mapstructure v1.5.0 // indirect
15+
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
16+
github.com/spf13/afero v1.9.5 // indirect
17+
github.com/spf13/cast v1.5.1 // indirect
18+
github.com/spf13/jwalterweatherman v1.1.0 // indirect
19+
github.com/spf13/pflag v1.0.5 // indirect
20+
github.com/subosito/gotenv v1.4.2 // indirect
21+
golang.org/x/sys v0.8.0 // indirect
22+
golang.org/x/text v0.9.0 // indirect
23+
gopkg.in/ini.v1 v1.67.0 // indirect
24+
gopkg.in/yaml.v3 v3.0.1 // indirect
25+
)
26+
27+
go 1.20

0 commit comments

Comments
 (0)