ZhangZhihui's Blog  

 

zzh@ZZHPC:/zdata/Github/mastering-go-expertise/stats_web/server$ go run .
Ready to serve at :1234

 

zzh@ZZHPC:~$ curl localhost:1234/list
d6	4	2.325000	1.080220
d4	5	2.860000	1.441666
d2	9	1.000000	0.000000
v2	7	1.000000	3.422614
v1	5	3.000000	1.414214

 

zzh@ZZHPC:/zdata/Github/mastering-go-expertise/stats_web/server$ go run .
Ready to serve at :1234
2024/06/26 17:35:59 Serving: /list from localhost:1234

 

zzh@ZZHPC:/zdata/Github/mastering-go-expertise/stats_web/client$ go run main.go list
Get "http://locahost:1234/list": dial tcp: lookup locahost on 127.0.0.53:53: server misbehaving

 

It turned out that a typo caused this error. I typed 'localhost' correctly in the curl command, but typed 'locahost' in the http.Get statement. After correcting the typo, the error is gone.

posted on 2024-06-26 17:41  ZhangZhihuiAAA  阅读(58)  评论(0编辑  收藏  举报