-1

I'm trying to compile my application in Go and I'm getting the following errors:

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

I'm unsure What I'm doing wrong.

http.go {line 104}:

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


http.go {line 114}:

        case syscall.SIGUSR2:


http.go {line 154}:

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


Import() section:

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

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

setup.go {line 24}:

    runner.MustPing(db)

Import() section:

    runner "gopkg.in/mgutz/dat.v1/sqlx-runner"
OrangeDog
  • 36,653
  • 12
  • 122
  • 207
  • 2
    Maybe this is the same issue https://github.com/facebookgo/grace/issues/15? – ttomalak Mar 25 '18 at 10:26
  • I don't think github.com/facebookgo/grace supports Windows. Issue 15 seems to cover it, and contains a workaround. Of course [now that Go has this functionality](https://gist.github.com/peterhellberg/38117e546c217960747aacf689af3dc2) in the standard library, you can just use that. – Michael Hampton Mar 25 '18 at 20:11
  • @MichaelHampton i thought about that and saw it, but does compiling a webapp really require a specific OS for certain repos? If so i'll resort back to my linux machine. Thanks. – AndrewWilliams Mar 25 '18 at 23:13
  • I have no reason to believe Facebook would have ever needed or wanted to make their code run on Windows. Their scale is just too enormous for it, at least internally. And no, not all Go code is portable. The OS-specific stuff in the standard library is carefully isolated enough that you don't generally notice, but with third party code, who knows. – Michael Hampton Mar 26 '18 at 00:37
  • @MichaelHampton i'm having the same issue on my linux computer. Any ideas? http.go fixed, but sqlx-runner same issue. – AndrewWilliams Mar 26 '18 at 06:51
  • Sorry, I did not realize you had two separate questions. The format of [so] works best when there is only one question per post. – Michael Hampton Mar 26 '18 at 16:12
  • 1
    @AndrewWilliams please don't vandalise your answered question. It may still be useful to others. – OrangeDog Aug 28 '18 at 09:26

1 Answers1

0

Solution to the first problem:
Gracehttp simply does not support windows. switching to my other OS fixed the compiling problem.

Solution to the second problem:
sqlx runner is outdated. switched to a more updated alternative.