修正dial.go中格式化输出语句 (#411)

* 修正dial.go例子中格式化输出语句的错误

* 修正dial.go例子中格式化输出语句的错误
This commit is contained in:
Eawaun
2017-10-13 04:07:14 -05:00
committed by 无闻
parent 7a552a5d3b
commit c39e071188
2 changed files with 4 additions and 4 deletions

View File

@@ -142,10 +142,10 @@ func main() {
} }
func checkConnection(conn net.Conn, err error) { func checkConnection(conn net.Conn, err error) {
if err != nil { if err != nil {
fmt.Printf("error %v connecting!") fmt.Printf("error %v connecting!", err)
os.Exit(1) os.Exit(1)
} }
fmt.Println("Connection is made with %v", conn) fmt.Printf("Connection is made with %v\n", conn)
} }
``` ```
下边也是一个使用net包从socket中打开写入读取数据的例子 下边也是一个使用net包从socket中打开写入读取数据的例子

View File

@@ -17,8 +17,8 @@ func main() {
} }
func checkConnection(conn net.Conn, err error) { func checkConnection(conn net.Conn, err error) {
if err != nil { if err != nil {
fmt.Printf("error %v connecting!") fmt.Printf("error %v connecting!", err)
os.Exit(1) os.Exit(1)
} }
fmt.Println("Connection is made with %v", conn) fmt.Printf("Connection is made with %v\n", conn)
} }