Merge pull request #84 from sbezverk/error_wrap
Replace %v with %w to wrap netlink error
This commit is contained in:
commit
7a7d417622
|
@ -5,14 +5,14 @@ dist: trusty
|
|||
|
||||
language: go
|
||||
go:
|
||||
- "1.10"
|
||||
- "1.13"
|
||||
|
||||
script:
|
||||
# Check whether files are syntactically correct.
|
||||
- "gofmt -l $(find . -name '*.go' | tr '\\n' ' ') >/dev/null"
|
||||
# Check whether files were not gofmt'ed.
|
||||
- "gosrc=$(find . -name '*.go' | tr '\\n' ' '); [ $(gofmt -l $gosrc 2>&- | wc -l) -eq 0 ] || (echo 'gofmt was not run on these files:'; gofmt -l $gosrc 2>&-; false)"
|
||||
- go tool vet .
|
||||
- go vet .
|
||||
- go test ./...
|
||||
- go test -c github.com/google/nftables
|
||||
- sudo ./nftables.test -test.v -run_system_tests
|
||||
|
|
4
conn.go
4
conn.go
|
@ -57,11 +57,11 @@ func (cc *Conn) Flush() error {
|
|||
defer conn.Close()
|
||||
|
||||
if _, err := conn.SendMessages(batch(cc.messages)); err != nil {
|
||||
return fmt.Errorf("SendMessages: %v", err)
|
||||
return fmt.Errorf("SendMessages: %w", err)
|
||||
}
|
||||
|
||||
if _, err := conn.Receive(); err != nil {
|
||||
return fmt.Errorf("Receive: %v", err)
|
||||
return fmt.Errorf("Receive: %w", err)
|
||||
}
|
||||
|
||||
cc.messages = nil
|
||||
|
|
Loading…
Reference in New Issue