Ver código fonte

Fix a few style issues pointed out by golint.

Dave Collins 12 anos atrás
pai
commit
f0ba95e184
3 arquivos alterados com 4 adições e 6 exclusões
  1. 1 1
      spew/config.go
  2. 3 3
      spew/dump.go
  3. 0 2
      spew/spew.go

+ 1 - 1
spew/config.go

@@ -84,7 +84,7 @@ type ConfigState struct {
 
 // Config is the active configuration of the top-level functions.
 // The configuration can be changed by modifying the contents of spew.Config.
-var Config ConfigState = ConfigState{Indent: " "}
+var Config = ConfigState{Indent: " "}
 
 // Errorf is a wrapper for fmt.Errorf that treats each argument as if it were
 // passed with a Formatter interface returned by c.NewFormatter.  It returns

+ 3 - 3
spew/dump.go

@@ -272,9 +272,9 @@ func (s *valuesSorter) Less(i, j int) bool {
 	return s.values[i].String() < s.values[j].String()
 }
 
-// Generic sort function for native types: int, uint, bool, string and uintptr.
-// Other inputs are sort according to their Value.String() value to ensure
-// display stability.
+// SortValues is a generic sort function for native types: int, uint, bool,
+// string and uintptr.  Other inputs are sorted according to their
+// Value.String() value to ensure display stability.
 func SortValues(values []reflect.Value) {
 	if len(values) == 0 {
 		return

+ 0 - 2
spew/spew.go

@@ -104,8 +104,6 @@ func Println(a ...interface{}) (n int, err error) {
 	return fmt.Println(convertArgs(a)...)
 }
 
-// Sprintf formats according to a format specifier and returns the resulting string.
-//
 // Sprint is a wrapper for fmt.Sprint that treats each argument as if it were
 // passed with a default Formatter interface returned by NewFormatter.  It
 // returns the resulting string.  See NewFormatter for formatting details.