```go
package main
import (
"io/ioutil"
"net/http"
"os"
)
func main() {
http.HandleFunc("/list/", func(writer http.ResponseWriter, request *http.Request) {
path := request.URL.Path[len("/list/"):]
file, err := os.Open(path)
if err != nil {
panic(err)
}
defer file.Close()
all, err := ioutil.ReadAll(file)
if err != nil {
panic(err)
}
writer.Write(all)
})
err := http.ListenAndServe("0.0.0.0:8000 ", nil)
if err != nil {
panic(err)
}
}
```
panic: listen tcp: lookup tcp/8000 : nodename nor servname provided, or not known
goroutine 1 [running]:
main.main()
/Users/doufangyu/GolandProjects/Go-Learngo/errhandling/filelistenserver/web.go:29 +0x7f
求大佬给个解决思路
有疑问加站长微信联系(非本文作者)