Explorar o código

Update 10.6.md (#790)

Kang Jing %!s(int64=5) %!d(string=hai) anos
pai
achega
a01ea97327
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      eBook/10.6.md

+ 3 - 3
eBook/10.6.md

@@ -519,15 +519,15 @@ func (l *Log) String() string {
 }
 
 func (c *Customer) String() string {
-	return c.Name + "\nLog:" + fmt.Sprintln(c.Log)
+	return c.Name + "\nLog:" + fmt.Sprintln(c.Log.String())
 }
 ```
 
 输出:
 
     Barak Obama
-    Log:{1 - Yes we can!
-    2 - After me the world will be a better place!}
+    Log:1 - Yes we can!
+    2 - After me the world will be a better place!
 
 内嵌的类型不需要指针,`Customer` 也不需要 `Add` 方法,它使用 `Log` 的 `Add` 方法,`Customer` 有自己的 `String` 方法,并且在它里面调用了 `Log` 的 `String` 方法。