From 275a36d0a03ab384fbf34cca7fbee094d95fc0b2 Mon Sep 17 00:00:00 2001 From: CodeLingo Bot Date: Wed, 13 Feb 2019 00:48:45 +0000 Subject: [PATCH] Fix function comments based on best practices from Effective Go Signed-off-by: CodeLingo Bot --- flags.go | 2 +- viper.go | 4 ++-- viper_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/flags.go b/flags.go index dd32f4e..b5ddbf5 100644 --- a/flags.go +++ b/flags.go @@ -36,7 +36,7 @@ type pflagValue struct { 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 { return p.flag.Changed } diff --git a/viper.go b/viper.go index 859a86f..5c441b4 100644 --- a/viper.go +++ b/viper.go @@ -226,7 +226,7 @@ func New() *Viper { 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 // can use it in their testing as well. func Reset() { @@ -1142,7 +1142,7 @@ func (v *Viper) SetEnvKeyReplacer(r *strings.Replacer) { 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 func RegisterAlias(alias string, key string) { v.RegisterAlias(alias, key) } func (v *Viper) RegisterAlias(alias string, key string) { diff --git a/viper_test.go b/viper_test.go index 75afaae..f91791f 100644 --- a/viper_test.go +++ b/viper_test.go @@ -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) { m := make(map[string]bool) key := "BenchmarkGetBool"