Fix function comments based on best practices from Effective Go

Signed-off-by: CodeLingo Bot <bot@codelingo.io>
This commit is contained in:
CodeLingo Bot 2019-02-13 00:48:45 +00:00 committed by Márk Sági-Kazár
parent 7fdad0204e
commit 275a36d0a0
3 changed files with 4 additions and 4 deletions

View file

@ -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
} }

View file

@ -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) {

View file

@ -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"