Giter Site home page Giter Site logo

incorrect interface about flock HOT 4 CLOSED

gofrs avatar gofrs commented on May 20, 2024
incorrect interface

from flock.

Comments (4)

theckman avatar theckman commented on May 20, 2024

I think panics being an intentional design decision in an interface is not a good choice, and isn't something I'd personally want to support. If you'd like to work with that interface instead, I think it's better to write a shim that wraps the flock library, versus complicating this package further.

from flock.

acln0 avatar acln0 commented on May 20, 2024

Flock does not exactly follow the sync.Locker interface

Indeed, it does not. I don't think it should, either, because the semantics don't match. sync.Locker is not the right interface if lock and unlock operations may fail, which is the case for flock operations. To wit, perhaps the package-level documentation should be adjusted such that it does not mention sync.Locker anymore. I'll send a PR.

from flock.

KaiserKarel avatar KaiserKarel commented on May 20, 2024

Either way seems fine to me. There are way more things that may panic with filelocks, so I get the aversion to panics. Simply fixing the Readme removes confusion as well.

Will close since I don't think much can be said, more of a sematics problem.

from flock.

KaiserKarel avatar KaiserKarel commented on May 20, 2024

Either way seems fine to me. There are way more things that may panic with filelocks, so I get the aversion to panics. Simply fixing the Readme removes confusion as well.

from flock.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.