Comments (2)
I mean:
func my() error {
if err = doSomething(); err != nil {
return err
}
// ...
}
Instead of:
func my() {
if err = doSomething(); err != nil {
log.Fatalf("....", err) // fmt.Fatal*, os.Exit, etc
}
}
I'm personally not much a fan of *.Fatal*
or other things that rely on os.Exit()
. It doesn't allow other parts of the code to do proper cleanup (skips deferred functions) and/or recover from errors or do error handling. IMO even panic()
would've been better. *.Fatal*
is a last resort type of thing.
But that's just (my own?) code style. It's your call, don't sweat it too much.
from log-shuttle.
For a library, I'm in total agreement with you.
And as I said elsewhere the only places log.Fatal get's used in to abort and exit as fast as possible during setup tasks.
Thanks for the thought our response though.
from log-shuttle.
Related Issues (20)
- GC Churn HOT 1
- Use Logplex-Loss-Count instead of Logshuttle-Drops as drop header HOT 10
- an alltime.processed or similar would be nice HOT 2
- no support for utf8 HOT 3
- Update Docs
- Retry Harder HOT 2
- Can't build on OS X 10.9 HOT 4
- Libraries that emit stuff to stdout/stderr/syslog kinda suck. HOT 1
- Option to report metrics to librato HOT 1
- Disordered Logs HOT 3
- Race condition on LogLineReader.ReadLogLines and Shuttle.Land HOT 3
- github.com/pebbe/util.IsTerminal failing on Go 1.5rc1 HOT 3
- Kinesis records only use a single partition key HOT 2
- Log-Shuttle 0.13.0/0.13.1 Release not hosted on Docker Hub HOT 2
- Add a kafka outlet
- New reader/batcher doesn't update batch.fill metrics
- Log-shuttle binary not copied into docker container for 0.15.0 and 0.16.0 releases HOT 3
- Docker images from 0.16.3 onward cannot be run HOT 1
- AWS Kinesis delivery requires static credentials HOT 2
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 log-shuttle.