Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos and style #147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions spew/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func catchPanic(w io.Writer, v reflect.Value) {
}

// handleMethods attempts to call the Error and String methods on the underlying
// type the passed reflect.Value represents and outputes the result to Writer w.
// type the passed reflect.Value represents and outputs the result to Writer w.
//
// It handles panics in any called methods by catching and displaying the error
// as the formatted value.
Expand All @@ -100,7 +100,7 @@ func handleMethods(cs *ConfigState, w io.Writer, v reflect.Value) (handled bool)
// Choose whether or not to do error and Stringer interface lookups against
// the base type or a pointer to the base type depending on settings.
// Technically calling one of these methods with a pointer receiver can
// mutate the value, however, types which choose to satisify an error or
// mutate the value, however, types which choose to satisfy an error or
// Stringer interface with a pointer receiver should not be mutating their
// state inside these interface methods.
if !cs.DisablePointerMethods && !UnsafeDisabled && !v.CanAddr() {
Expand Down
6 changes: 3 additions & 3 deletions spew/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type ConfigState struct {
//
// NOTE: This might be an unsafe action since calling one of these methods
// with a pointer receiver could technically mutate the value, however,
// in practice, types which choose to satisify an error or Stringer
// in practice, types which choose to satisfy an error or Stringer
// interface with a pointer receiver should not be mutating their state
// inside these interface methods. As a result, this option relies on
// access to the unsafe package, so it will not have any effect when
Expand All @@ -72,7 +72,7 @@ type ConfigState struct {
DisablePointerAddresses bool

// DisableCapacities specifies whether to disable the printing of capacities
// for arrays, slices, maps and channels. This is useful when diffing
// for arrays, slices, maps, and channels. This is useful when diffing
// data structures in tests.
DisableCapacities bool

Expand Down Expand Up @@ -228,7 +228,7 @@ types similar to the standard %v format specifier.

The custom formatter only responds to the %v (most compact), %+v (adds pointer
addresses), %#v (adds types), and %#+v (adds types and pointer addresses) verb
combinations. Any other verbs such as %x and %q will be sent to the the
combinations. Any other verbs such as %x and %q will be sent to the
standard fmt package for formatting. In addition, the custom formatter ignores
the width and precision arguments (however they will still work on the format
specifiers not handled by the custom formatter).
Expand Down
2 changes: 1 addition & 1 deletion spew/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ standard %v format specifier.

The custom formatter only responds to the %v (most compact), %+v (adds pointer
addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb
combinations. Any other verbs such as %x and %q will be sent to the the
combinations. Any other verbs such as %x and %q will be sent to the
standard fmt package for formatting. In addition, the custom formatter ignores
the width and precision arguments (however they will still work on the format
specifiers not handled by the custom formatter).
Expand Down
2 changes: 1 addition & 1 deletion spew/dumpcgo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// NOTE: Due to the following build constraints, this file will only be compiled
// when both cgo is supported and "-tags testcgo" is added to the go test
// command line. This means the cgo tests are only added (and hence run) when
// specifially requested. This configuration is used because spew itself
// specifically requested. This configuration is used because spew itself
// does not require cgo to run even though it does handle certain cgo types
// specially. Rather than forcing all clients to require cgo and an external
// C compiler just to run the tests, this scheme makes them optional.
Expand Down
6 changes: 3 additions & 3 deletions spew/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (f *formatState) formatPtr(v reflect.Value) {
// Keep list of all dereferenced pointers to possibly show later.
pointerChain := make([]uintptr, 0)

// Figure out how many levels of indirection there are by derferencing
// Figure out how many levels of indirection there are by dereferencing
// pointers and unpacking interfaces down the chain while detecting circular
// references.
nilFound := false
Expand Down Expand Up @@ -405,12 +405,12 @@ types similar to the standard %v format specifier.

The custom formatter only responds to the %v (most compact), %+v (adds pointer
addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb
combinations. Any other verbs such as %x and %q will be sent to the the
combinations. Any other verbs such as %x and %q will be sent to the
standard fmt package for formatting. In addition, the custom formatter ignores
the width and precision arguments (however they will still work on the format
specifiers not handled by the custom formatter).

Typically this function shouldn't be called directly. It is much easier to make
Typically, this function shouldn't be called directly. It is much easier to make
use of the custom formatter by calling one of the convenience functions such as
Printf, Println, or Fprintf.
*/
Expand Down
2 changes: 1 addition & 1 deletion spew/internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

/*
This test file is part of the spew package rather than than the spew_test
This test file is part of the spew package rather than the spew_test
package because it needs access to internals to properly test certain cases
which are not possible via the public interface since they should never happen.
*/
Expand Down
4 changes: 2 additions & 2 deletions spew/internalunsafe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// +build !js,!appengine,!safe,!disableunsafe,go1.4

/*
This test file is part of the spew package rather than than the spew_test
This test file is part of the spew package rather than the spew_test
package because it needs access to internals to properly test certain cases
which are not possible via the public interface since they should never happen.
*/
Expand All @@ -46,7 +46,7 @@ func changeKind(v *reflect.Value, readOnly bool) {
*flags |= flagKindMask
}

// TestAddedReflectValue tests functionaly of the dump and formatter code which
// TestAddedReflectValue tests functionality of the dump and formatter code which
// falls back to the standard fmt library for new types that might get added to
// the language.
func TestAddedReflectValue(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion spew/spew_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func initSpewTests() {
}
tptr := &ptrTester{s: &struct{}{}}

// depthTester is used to test max depth handling for structs, array, slices
// depthTester is used to test max depth handling for structs, array, slices,
// and maps.
type depthTester struct {
ic indirCir1
Expand Down