Comments (2)
Hi Daniel,
We would love to take you up on your offer to help enable errcheck.
Your suggestion on just focusing on non-test code for now seems spot on.
_, _ = w.Write(...)
// or
w.Write(...) //nolint:errcheck
I think I would prefer the latter since it will be easier to spot and search for. So let's go with the //nolint:errcheck approach.
Thanks for offering to help and your clear write-up of the types of changes that would be needed.
from weaver.
Initially I'd want to enable it only for production code (not tests), to limit the number of changes required to get it enabled. Something like this:
issues:
exclude-rules:
- path: '_test\.go'
linters: [errcheck]
I think a bunch of the unhandled errors are safe to ignore (ex: writing an HTTP response from a handler). Those can be ignored with either:
_, _ = w.Write(...)
// or
w.Write(...) //nolint:errcheck
Do you have a preference on one of those styles?
There are a few cases where it seems like the error simply needs to be returned:
weaver/runtime/logging/query.go
Lines 370 to 371 in 2ae2abb
weaver/internal/tool/ssh/impl/babysitter.go
Lines 103 to 104 in 2ae2abb
weaver/internal/net/call/call.go
Line 283 in 2ae2abb
or logged:
weaver/internal/tool/ssh/deploy.go
Line 107 in 2ae2abb
weaver/internal/status/dashboard.go
Line 177 in 2ae2abb
weaver/internal/net/call/call.go
Line 420 in 2ae2abb
A log here to inform the user that the port is in use would probably help avoid confusion when perfetto isn't able to display the trace.
Line 526 in 2ae2abb
The remaining cases of unhandled errors seems to be mostly in these two categories:
- starting goroutines with a function that returns an error - in a few of these cases the only possible return value is
ctx.Err
. I wonder if the error return value could be removed from the function signature in those cases. - sending an RPC response from an RPC handler when the operation is performed in a goroutine. In these cases I expect the error is also safe to ignore because the client receives the error response, and the caller doesn't care about it.
from weaver.
Related Issues (20)
- Is integration with Wire possible? HOT 1
- feat: adding a Global Config Default Configuration HOT 3
- looking forward to update component interface HOT 2
- Best Practice for serving HTTP/S Traffic HOT 2
- Panic in generate when main contains os.Exit HOT 1
- https://serviceweaver.dev/examples.html broken for safari HOT 1
- The issue of errors in cross package serialization processing HOT 3
- How do I call the written component in the program in a conventional way? HOT 1
- is context.Context propagtion supported in deploy multi? HOT 3
- context propagtion HOT 1
- multi deployment totally crashs after panic HOT 1
- initialize once in multi deploy mode HOT 1
- Replicated SQLite using Pocketbase and Marmot ( jetstream )
- Multi deployment: Blocks on first replica if other replica fails to start HOT 2
- Handling DB cleanup correctly HOT 5
- [Question] Weaver generate error in go/type.(*Checker) HOT 2
- Run alongside gRPC (will not HTTP2)
- Version mismatch with weaver-kube HOT 4
- Weaver generate process is not finished HOT 3
- Duplicate Method Executions in weavertest.RPC Mode HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from weaver.