From: Brad Fitzpatrick Date: Thu, 16 Apr 2015 16:58:16 +0000 (+0000) Subject: Revert "fmt: add a few more reflect.Value tests" X-Git-Tag: go1.5beta1~1068 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=db1f9cdd3fc3b7238b5fbd58447e6b742a90f422;p=gostls13.git Revert "fmt: add a few more reflect.Value tests" This reverts commit 3e6b7f35de96414a3a393f0ad25326f411101776. Change-Id: Icad2b235b9880729fbdf80d7dfd71e56df4b1231 Reviewed-on: https://go-review.googlesource.com/8944 Reviewed-by: Brad Fitzpatrick --- diff --git a/src/fmt/fmt_test.go b/src/fmt/fmt_test.go index 948df3579c..96505b8271 100644 --- a/src/fmt/fmt_test.go +++ b/src/fmt/fmt_test.go @@ -686,14 +686,6 @@ var fmtTests = []struct { // Issue 8965. {"%v", reflect.ValueOf(A{}).Field(0).String(), ""}, // Equivalent to the old way. {"%v", reflect.ValueOf(A{}).Field(0), "0"}, // Sees inside the field. - - // verbs apply to the extracted value too. - {"%s", reflect.ValueOf("hello"), "hello"}, - {"%q", reflect.ValueOf("hello"), `"hello"`}, - {"%#04x", reflect.ValueOf(256), "0x0100"}, - - // invalid reflect.Value doesn't crash. - {"%v", reflect.Value{}, ""}, } // zeroFill generates zero-filled strings of the specified width. The length diff --git a/src/fmt/print.go b/src/fmt/print.go index 8e35a890ec..c8038f09a8 100644 --- a/src/fmt/print.go +++ b/src/fmt/print.go @@ -847,8 +847,6 @@ func (p *pp) printReflectValue(value reflect.Value, verb rune, depth int) (wasSt p.value = value BigSwitch: switch f := value; f.Kind() { - case reflect.Invalid: - p.buf.WriteString("") case reflect.Bool: p.fmtBool(f.Bool(), verb) case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: