mirror of
https://gitee.com/johng/gf
synced 2026-06-07 02:12:11 +08:00
remove auto-adding main package path to search path of WebServer in develop environment
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user