remove auto-adding main package path to search path of WebServer in develop environment

This commit is contained in:
John
2018-12-11 19:30:38 +08:00
parent 60a571f291
commit 670993f769

View File

@ -15,7 +15,6 @@ import (
"gitee.com/johng/gf/g/container/gtype"
"gitee.com/johng/gf/g/os/gcache"
"gitee.com/johng/gf/g/os/genv"
"gitee.com/johng/gf/g/os/gfile"
"gitee.com/johng/gf/g/os/glog"
"gitee.com/johng/gf/g/os/gproc"
"gitee.com/johng/gf/g/os/gtime"
@ -212,14 +211,6 @@ func (s *Server) Start() error {
return errors.New("server is already running")
}
// 仅在开启静态文件服务的时候有效
if s.config.FileServerEnabled {
// (开发环境)添加main源码包到搜索目录
if p := gfile.MainPkgPath(); p != "" && gfile.Exists(p) {
s.AddSearchPath(p)
}
}
// 底层http server配置
if s.config.Handler == nil {
s.config.Handler = http.HandlerFunc(s.defaultHttpHandle)