mirror of
https://github.com/gopl-zh/gopl-zh.github.com.git
synced 2025-08-08 08:12:02 +00:00
ch12: fix code path
This commit is contained in:
@@ -2,9 +2,8 @@
|
||||
|
||||
我們的最後一個例子是使用reflect.Type來打印任意值的類型和枚舉它的方法:
|
||||
|
||||
<u><i>gopl.io/ch12/methods</i></u>
|
||||
```Go
|
||||
gopl.io/ch12/methods
|
||||
|
||||
// Print prints the method set of the value x.
|
||||
func Print(x interface{}) {
|
||||
v := reflect.ValueOf(x)
|
||||
@@ -39,6 +38,3 @@ methods.Print(new(strings.Replacer))
|
||||
// func (*strings.Replacer) Replace(string) string
|
||||
// func (*strings.Replacer) WriteString(io.Writer, string) (int, error)
|
||||
````
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user