This repository was archived by the owner on Oct 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Dependency upgrade #20
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
09dd211
chore: (deps) upgrade dependencies to latest versions
christiannicola 6a6a1ea
chore: (api) enable JSON logging, additional tests
christiannicola bd51ce5
chore: (nix) disable check phase for nix build
christiannicola 71c71e8
chore: (pr) feedback
christiannicola File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| package main | ||
|
|
||
| import ( | ||
| "os" | ||
| "sync" | ||
| "testing" | ||
| "time" | ||
|
|
||
| "github.com/test-go/testify/assert" | ||
| ) | ||
|
|
||
| func TestMain(t *testing.T) { | ||
| assert.NoError(t, os.Setenv("HTTP_PORT", "8888")) | ||
|
|
||
| wg := sync.WaitGroup{} | ||
| wg.Add(2) | ||
|
|
||
| go func() { | ||
| defer wg.Done() | ||
| assert.NotPanics(t, func() { | ||
| main() | ||
| }) | ||
| }() | ||
|
|
||
| go func() { | ||
| defer wg.Done() | ||
|
|
||
| c := time.Tick(time.Second * 3) | ||
| <-c | ||
| assert.NoError(t, sendInterruptSignal(os.Getpid())) | ||
| }() | ||
|
|
||
| wg.Wait() | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| //go:build !windows | ||
|
|
||
| package main | ||
|
|
||
| import ( | ||
| "os" | ||
| ) | ||
|
|
||
| func sendInterruptSignal(pid int) error { | ||
| proc, err := os.FindProcess(pid) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| return proc.Signal(os.Interrupt) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| //go:build windows | ||
|
|
||
| package main | ||
|
|
||
| import ( | ||
| "golang.org/x/sys/windows" | ||
| ) | ||
|
|
||
| func sendInterruptSignal(pid int) error { | ||
| // NOTE (c.nicola): PROCESS_TERMINATE is more or less the equivalent to signal.SIGTERM. | ||
| // Windows does not have interrupt signals (at least not in Go), so | ||
| // we need to use the windows module and terminate the process. | ||
| // This won't trigger the graceful shutdown routines, so keep that in mind. | ||
| proc, err := windows.OpenProcess(windows.PROCESS_TERMINATE, false, uint32(pid)) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| if err = windows.TerminateProcess(proc, 0); err != nil { | ||
| return err | ||
| } | ||
|
|
||
| return windows.CloseHandle(proc) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.