Fix indentation after removed fields, reverted imports, updated test
This commit is contained in:
parent
33f49b1830
commit
5fb934ca7a
|
@ -75,7 +75,7 @@ import (
|
||||||
"html"
|
"html"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/coreyog/go-spew/spew"
|
||||||
)
|
)
|
||||||
|
|
||||||
func handler(w http.ResponseWriter, r *http.Request) {
|
func handler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
|
@ -21,7 +21,7 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/coreyog/go-spew/spew"
|
||||||
)
|
)
|
||||||
|
|
||||||
// custom type to test Stinger interface on non-pointer receiver.
|
// custom type to test Stinger interface on non-pointer receiver.
|
||||||
|
|
|
@ -413,12 +413,12 @@ func (d *dumpState) dump(v reflect.Value) {
|
||||||
vt := v.Type()
|
vt := v.Type()
|
||||||
numFields := v.NumField()
|
numFields := v.NumField()
|
||||||
for i := 0; i < numFields; i++ {
|
for i := 0; i < numFields; i++ {
|
||||||
d.indent()
|
|
||||||
vtf := vt.Field(i)
|
vtf := vt.Field(i)
|
||||||
tag := vtf.Tag.Get("spew")
|
tag := vtf.Tag.Get("spew")
|
||||||
if tag == "-" {
|
if tag == "-" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
d.indent()
|
||||||
d.w.Write([]byte(vtf.Name))
|
d.w.Write([]byte(vtf.Name))
|
||||||
d.w.Write(colonSpaceBytes)
|
d.w.Write(colonSpaceBytes)
|
||||||
d.ignoreNextIndent = true
|
d.ignoreNextIndent = true
|
||||||
|
|
|
@ -67,7 +67,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/coreyog/go-spew/spew"
|
||||||
)
|
)
|
||||||
|
|
||||||
// dumpTest is used to describe a test to be performed against the Dump method.
|
// dumpTest is used to describe a test to be performed against the Dump method.
|
||||||
|
|
|
@ -26,7 +26,7 @@ package spew_test
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/davecgh/go-spew/spew/testdata"
|
"github.com/coreyog/go-spew/spew/testdata"
|
||||||
)
|
)
|
||||||
|
|
||||||
func addCgoDumpTests() {
|
func addCgoDumpTests() {
|
||||||
|
|
|
@ -19,7 +19,7 @@ package spew_test
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/coreyog/go-spew/spew"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Flag int
|
type Flag int
|
||||||
|
|
|
@ -72,7 +72,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/coreyog/go-spew/spew"
|
||||||
)
|
)
|
||||||
|
|
||||||
// formatterTest is used to describe a test to be performed against NewFormatter.
|
// formatterTest is used to describe a test to be performed against NewFormatter.
|
||||||
|
|
|
@ -23,7 +23,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/coreyog/go-spew/spew"
|
||||||
)
|
)
|
||||||
|
|
||||||
// spewFunc is used to identify which public function of the spew package or
|
// spewFunc is used to identify which public function of the spew package or
|
||||||
|
@ -187,7 +187,7 @@ func initSpewTests() {
|
||||||
{scsDefault, fSprintf, "%v", complex(float32(-3), -4), "(-3-4i)"},
|
{scsDefault, fSprintf, "%v", complex(float32(-3), -4), "(-3-4i)"},
|
||||||
{scsDefault, fSprintln, "", complex(float64(-5), -6), "(-5-6i)\n"},
|
{scsDefault, fSprintln, "", complex(float64(-5), -6), "(-5-6i)\n"},
|
||||||
{scsDefault, fCSFdump, "", it, "(spew_test.ignoreTester) {\n" +
|
{scsDefault, fCSFdump, "", it, "(spew_test.ignoreTester) {\n" +
|
||||||
" visible: (bool) true\n }\n"},
|
" visible: (bool) true\n}\n"},
|
||||||
{scsNoMethods, fCSFprint, "", ts, "test"},
|
{scsNoMethods, fCSFprint, "", ts, "test"},
|
||||||
{scsNoMethods, fCSFprint, "", &ts, "<*>test"},
|
{scsNoMethods, fCSFprint, "", &ts, "<*>test"},
|
||||||
{scsNoMethods, fCSFprint, "", tps, "test"},
|
{scsNoMethods, fCSFprint, "", tps, "test"},
|
||||||
|
|
Loading…
Reference in New Issue