我在运行时使用 github.com/labstack/echo 包做了一个简单的工作,但遇到了这个错误。
github.com\labstack\echo\echo.go:624: e.AutoTLSManager.HTTPHandler undefined (type autocert.Manager has no field or method HTTPHandler
package main
import "github.com/labstack/echo"
func main() {
e := echo.New()
e.Start(":")
}
最佳答案
此问题已在 issue #1082 中得到解决:
You seem to have a stale acme/autocert library. autocert.Manager DOES currently have that method: https://godoc.org/golang.org/x/crypto/acme/autocert#Manager.HTTPHandler I suggest a
go get -u golang.org/x/crypto/acme/...
.
关于go - 使用Echo时编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50248884/