我有点困惑。许多示例显示了两者的用法:http.ServeFile(..)和http.FileServer(..),但似乎它们具有非常接近的功能。我也没有找到有关如何设置自定义NotFound处理程序的信息。//Thisworksandstrip"/static/"fragmentfrompathfs:=http.FileServer(http.Dir("static"))http.Handle("/static/",http.StripPrefix("/static/",fs))//Thisworkstoo,but"/static2/"fragmentremainsandneedto