mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 05:33:04 +08:00
Update 15.1.md
This commit is contained in:
@@ -281,6 +281,7 @@ func checkError(error error, info string) {
|
||||
>(**译者注:应该是由于go版本的更新,会提示os.EAGAIN undefined ,修改后的代码:[simple_tcp_server_v1.go](examples/chapter_15/simple_tcp_server_v1.go)**)
|
||||
|
||||
都有哪些改进?
|
||||
|
||||
(1)服务器地址和端口不再是硬编码,而是通过命令行传入参数并通过`flag`包来读取这些参数。这里使用了`flag.NArg()`检查是否按照期望传入了2个参数:
|
||||
```go
|
||||
if flag.NArg() != 2{
|
||||
|
Reference in New Issue
Block a user