提交 0382146c 编写于 作者: A astaxie

fix the go vet for go tip

上级 1bf52e89
...@@ -319,7 +319,7 @@ func LoadAppConfig(adapterName, configPath string) error { ...@@ -319,7 +319,7 @@ func LoadAppConfig(adapterName, configPath string) error {
} }
if !utils.FileExists(absConfigPath) { if !utils.FileExists(absConfigPath) {
return fmt.Errorf("the target config file: %s don't exist!", configPath) return fmt.Errorf("the target config file: %s don't exist", configPath)
} }
if absConfigPath == appConfigPath { if absConfigPath == appConfigPath {
......
...@@ -90,16 +90,15 @@ func (srv *Server) ListenAndServeTLS(certFile, keyFile string) (err error) { ...@@ -90,16 +90,15 @@ func (srv *Server) ListenAndServeTLS(certFile, keyFile string) (err error) {
addr = ":https" addr = ":https"
} }
config := &tls.Config{} if srv.TLSConfig == nil {
if srv.TLSConfig != nil { srv.TLSConfig = &tls.Config{}
*config = *srv.TLSConfig
} }
if config.NextProtos == nil { if srv.TLSConfig.NextProtos == nil {
config.NextProtos = []string{"http/1.1"} srv.TLSConfig.NextProtos = []string{"http/1.1"}
} }
config.Certificates = make([]tls.Certificate, 1) srv.TLSConfig.Certificates = make([]tls.Certificate, 1)
config.Certificates[0], err = tls.LoadX509KeyPair(certFile, keyFile) srv.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(certFile, keyFile)
if err != nil { if err != nil {
return return
} }
...@@ -113,7 +112,7 @@ func (srv *Server) ListenAndServeTLS(certFile, keyFile string) (err error) { ...@@ -113,7 +112,7 @@ func (srv *Server) ListenAndServeTLS(certFile, keyFile string) (err error) {
} }
srv.tlsInnerListener = newGraceListener(l, srv) srv.tlsInnerListener = newGraceListener(l, srv)
srv.GraceListener = tls.NewListener(srv.tlsInnerListener, config) srv.GraceListener = tls.NewListener(srv.tlsInnerListener, srv.TLSConfig)
if srv.isChild { if srv.isChild {
process, err := os.FindProcess(os.Getppid()) process, err := os.FindProcess(os.Getppid())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册