forked from mirror/viper
Fix function comments based on best practices from Effective Go
Signed-off-by: CodeLingo Bot <bot@codelingo.io>
This commit is contained in:
parent
7fdad0204e
commit
275a36d0a0
2
flags.go
2
flags.go
|
@ -36,7 +36,7 @@ type pflagValue struct {
|
||||||
flag *pflag.Flag
|
flag *pflag.Flag
|
||||||
}
|
}
|
||||||
|
|
||||||
// HasChanges returns whether the flag has changes or not.
|
// HasChanged returns whether the flag has changes or not.
|
||||||
func (p pflagValue) HasChanged() bool {
|
func (p pflagValue) HasChanged() bool {
|
||||||
return p.flag.Changed
|
return p.flag.Changed
|
||||||
}
|
}
|
||||||
|
|
4
viper.go
4
viper.go
|
@ -226,7 +226,7 @@ func New() *Viper {
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
// Intended for testing, will reset all to default settings.
|
// Reset: Intended for testing, will reset all to default settings.
|
||||||
// In the public interface for the viper package so applications
|
// In the public interface for the viper package so applications
|
||||||
// can use it in their testing as well.
|
// can use it in their testing as well.
|
||||||
func Reset() {
|
func Reset() {
|
||||||
|
@ -1142,7 +1142,7 @@ func (v *Viper) SetEnvKeyReplacer(r *strings.Replacer) {
|
||||||
v.envKeyReplacer = r
|
v.envKeyReplacer = r
|
||||||
}
|
}
|
||||||
|
|
||||||
// Aliases provide another accessor for the same key.
|
// RegisterAlias: Aliases provide another accessor for the same key.
|
||||||
// This enables one to change a name without breaking the application
|
// This enables one to change a name without breaking the application
|
||||||
func RegisterAlias(alias string, key string) { v.RegisterAlias(alias, key) }
|
func RegisterAlias(alias string, key string) { v.RegisterAlias(alias, key) }
|
||||||
func (v *Viper) RegisterAlias(alias string, key string) {
|
func (v *Viper) RegisterAlias(alias string, key string) {
|
||||||
|
|
|
@ -1774,7 +1774,7 @@ func BenchmarkGet(b *testing.B) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is the "perfect result" for the above.
|
// BenchmarkGetBoolFromMap is the "perfect result" for the above.
|
||||||
func BenchmarkGetBoolFromMap(b *testing.B) {
|
func BenchmarkGetBoolFromMap(b *testing.B) {
|
||||||
m := make(map[string]bool)
|
m := make(map[string]bool)
|
||||||
key := "BenchmarkGetBool"
|
key := "BenchmarkGetBool"
|
||||||
|
|
Loading…
Reference in New Issue