Skip to content
This repository has been archived by the owner on Mar 22, 2019. It is now read-only.

Implement a Windows fallback #29

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Implement a Windows fallback #29

wants to merge 10 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Aug 25, 2016

This PR implements a Win fall back version of Serve function to fix #15. This change will make the package buildable on Windows, though graceful restarts / shutdowns will not be supported on it.

Changelog

  • gracehttp/
    1. http.go and http_test.go are moved as-is to the nix.go and nix_test.go.
    2. +build !windows tags are added to both and to the testbin_test.go.
    3. pprintAddr and modification of (*app).listen(...) are moved from from the nix.go to the http.go where they can be reused between *nix and fallback versions of serve.
    4. serveFallback is implemented in the http.go and covered by tests (http_test.go). It doesn't have a +build windows tag to make testing of the function on other platforms possible.
    5. win.go with +build windows tag and Serve function (wrapper around the serveFallback) are added to be used on Windows.
  • gracedemo/
    1. gracehttp.Serve call is wrapped by log.Fatal to show the errors if any occur.

If this is not the approach you'd like to take, feel free to close the PR.

@ghost
Copy link
Author

ghost commented Aug 25, 2016

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks!

@ghost ghost added the CLA Signed label Aug 25, 2016
@ghost
Copy link
Author

ghost commented Aug 25, 2016

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@ghost
Copy link
Author

ghost commented Aug 25, 2016

I had to increment the version of Go as lint doesn't work with anything older than 1.5 and tool vet has been replaced by a Go built in command.

@ghost ghost added the CLA Signed label Aug 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

go get on windows failed
0 participants