Golang 未定义

标签 go glide-golang go-graceful

我正在尝试用 Go 编译我的应用程序,但出现以下错误:

C:\Users\Root\go\src\github.com\ussssseeeeeeerrr\test> go build
# github.com/facebookgo/grace/gracehttp
..\..\facebookgo\grace\gracehttp\http.go:104:53: undefined: syscall.SIGUSR2
..\..\facebookgo\grace\gracehttp\http.go:114:8: undefined: syscall.SIGUSR2
..\..\facebookgo\grace\gracehttp\http.go:154:13: undefined: syscall.Kill
# github.com/ussssseeeeeeerrr/test/models
C:\Go\src\github.com\ussssseeeeeeerrr\test\models\setup.go:24:2: undefined: runner.MustPing

我不确定我做错了什么。

http.go {第 104 行}:

    signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM, syscall.SIGUSR2)


http.go {第 114 行}:

        case syscall.SIGUSR2:


http.go {第 154 行}:

        if err := syscall.Kill(ppid, syscall.SIGTERM); err != nil {


Import() 部分:

    "bytes"
    "crypto/tls"
    "fmt"
    "log"
    "net"
    "net/http"
    "os"
    "os/signal"
    "sync"
    "syscall"

    "github.com/facebookgo/grace/gracenet"
    "github.com/facebookgo/httpdown"

setup.go {第 24 行}:

    runner.MustPing(db)

Import() 部分:

    runner "gopkg.in/mgutz/dat.v1/sqlx-runner"

最佳答案

第一个问题的解决方法:
Gracehttp 根本不支持windows。切换到我的其他操作系统解决了编译问题。

第二个问题的解决方法:
sqlx runner 已过时。切换到更新的替代方案。

关于Golang 未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49474742/

相关文章:

linux - arm 上的 autocert 中缺少字段或方法签名方案

go - 在同一包中找不到结构

go - 如何在 glide 中使用自定义包

http - 带有错误处理的 Golang 优雅 HTTP 服务器关闭

html - 随机数未呈现的HTML模板

debugging - 如何分析这个 Golang cpu pprof 快照?

html - 尽管表单有效,但 ParseMultipartForm 总是失败

windows - 将打印语句重定向到文件