URI: 
       helpers: Add documentation to some Language methods - hugo - [fork] hugo port for 9front
  HTML git clone git@git.drkhsh.at/hugo.git
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
   DIR README
   DIR LICENSE
       ---
   DIR commit 647540d0ef9819c35819715f1f35198f05e5409e
   DIR parent 700d531a2cbc612ee9e9c9843a01ae1f5e487969
  HTML Author: bogem <albertnigma@gmail.com>
       Date:   Mon, 21 Nov 2016 22:59:33 +0100
       
       helpers: Add documentation to some Language methods
       
       See #2014
       
       Diffstat:
         M helpers/language.go                 |      19 +++++++++++++++----
       
       1 file changed, 15 insertions(+), 4 deletions(-)
       ---
   DIR diff --git a/helpers/language.go b/helpers/language.go
       @@ -97,18 +97,29 @@ func (l *Language) SetParam(k string, v interface{}) {
                l.params[strings.ToLower(k)] = v
        }
        
       -func (l *Language) GetBool(key string) bool     { return cast.ToBool(l.Get(key)) }
       +// GetBool returns the value associated with the key as a boolean.
       +func (l *Language) GetBool(key string) bool { return cast.ToBool(l.Get(key)) }
       +
       +// GetString returns the value associated with the key as a string.
        func (l *Language) GetString(key string) string { return cast.ToString(l.Get(key)) }
       -func (l *Language) GetInt(key string) int       { return cast.ToInt(l.Get(key)) }
        
       -func (ml *Language) GetStringMap(key string) map[string]interface{} {
       -        return cast.ToStringMap(ml.Get(key))
       +// GetInt returns the value associated with the key as an int.
       +func (l *Language) GetInt(key string) int { return cast.ToInt(l.Get(key)) }
       +
       +// GetStringMap returns the value associated with the key as a map of interfaces.
       +func (l *Language) GetStringMap(key string) map[string]interface{} {
       +        return cast.ToStringMap(l.Get(key))
        }
        
       +// GetStringMapString returns the value associated with the key as a map of strings.
        func (l *Language) GetStringMapString(key string) map[string]string {
                return cast.ToStringMapString(l.Get(key))
        }
        
       +// Get returns a value associated with the key relying on pecified language.
       +// Get is case-insensitive for a key.
       +//
       +// Get returns an interface. For a specific value use one of the Get____ methods.
        func (l *Language) Get(key string) interface{} {
                if l == nil {
                        panic("language not set")