import ( "net/url")type Route struct{ filepath string url url.URL}func hello(){ fmt.Println("Hello World")}func main() { routes := map[Route]func{ Route{url.Parse("/home"), "/var/www/index.html"} : hello }}我無法弄清楚是什么語法錯誤阻止我將 Route 結構映射到函數。我收到此錯誤:./main.go:24:26: 語法錯誤:意外{,期待(./main.go:25:8: 語法錯誤:意外的 {,需要逗號或 )
將結構映射到go中的函數
慕尼黑8549860
2023-06-01 14:29:30