Skip to content

Commit

Permalink
chore: close pipes when closing relay
Browse files Browse the repository at this point in the history
Signed-off-by: Valery Piashchynski <[email protected]>
  • Loading branch information
rustatian committed Sep 7, 2022
1 parent e3ce25f commit d2ddea8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v3 # Action page: <https://github.com/golangci/golangci-lint-action>
with:
version: v1.48 # without patch version
version: v1.49 # without patch version
only-new-issues: false # show only new issues if it's a pull request
3 changes: 0 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ linters: # All available linters list: <https://golangci-lint.run/usage/linters/
enable:
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
- bodyclose # Checks whether HTTP response body is closed successfully
- deadcode # Finds unused code
- depguard # Go linter that checks if package imports are in a list of acceptable packages
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
- dupl # Tool for code clone detection
Expand All @@ -73,14 +72,12 @@ linters: # All available linters list: <https://golangci-lint.run/usage/linters/
- prealloc # Finds slice declarations that could potentially be preallocated
- rowserrcheck # Checks whether Err of rows is checked successfully
- staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks
- structcheck # Finds unused struct fields
- stylecheck # Stylecheck is a replacement for golint
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code
- unconvert # Remove unnecessary type conversions
- unparam # Reports unused function parameters
- unused # Checks Go code for unused constants, variables, functions and types
- varcheck # Finds unused global variables and constants
- whitespace # Tool for detection of leading and trailing whitespace

issues:
Expand Down
4 changes: 3 additions & 1 deletion pkg/pipe/pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ func (rl *Relay) Receive(frame *frame.Frame) error {
return internal.ReceiveFrame(rl.in, frame)
}

// Close the connection. Pipes are closed automatically with the underlying process.
// Close the connection
func (rl *Relay) Close() error {
_ = rl.out.Close()
_ = rl.in.Close()
return nil
}

0 comments on commit d2ddea8

Please sign in to comment.