Giter Club home page Giter Club logo

Comments (8)

zombiezen avatar zombiezen commented on May 3, 2024 1

@tbpg awscloud and gcpcloud are unlikely to be imported together, but some of the other ones (s3, sql, xray) would collide with the provider-given packages.

While there's some stutter in the import path, I liken this to "path/filepath": the name file would not be evocative enough of the package's purpose.

from go-cloud.

zombiezen avatar zombiezen commented on May 3, 2024 1

The naming collisions and readability arguments win out here, let's keep the status quo.

from go-cloud.

jeanbza avatar jeanbza commented on May 3, 2024

Those names are nicer for sure from a maintainer's point of view, but less descriptive from a user's point of view. A maintainer sees blob/fileblob vs blob/file but a user sees fileblob.Whatever vs file.Whatever. The latter is nicer for the maintainer but the former is nicer for the user.

from go-cloud.

cflewis avatar cflewis commented on May 3, 2024

I'm personally in favor of the renames as suggested. Assigning to @zombiezen and @shantuo for other votes.

from go-cloud.

cflewis avatar cflewis commented on May 3, 2024

But I understand @jadekler 's reservations. I think in the end, the idiomatic aspects outweigh the readability aspects, if the dev is having issues they can always alias the package.

from go-cloud.

tbpg avatar tbpg commented on May 3, 2024
aws/awscloud      -> aws/cloud
gcp/gcpcloud      -> gcp/cloud

These are the only two I might be concerned about. Would it be common for users to import both of these into a single package?

I'm thinking of this paragraph from https://blog.golang.org/package-names:

Avoid unnecessary package name collisions. While packages in different directories may have the same name, packages that are frequently used together should have distinct names. This reduces confusion and the need for local renaming in client code. For the same reason, avoid using the same name as popular standard packages like io or http.

from go-cloud.

broady avatar broady commented on May 3, 2024

What does usage look like? The calling code should help inform the package name. If it's an underscore import, then I agree w/ the proposal. If not, cloud seems like an overly generic name for the import.

from go-cloud.

zombiezen avatar zombiezen commented on May 3, 2024

The calling code will not be using underscore imports; they will be referring to the provider sets inside the package (current examples are awscloud.Services and awscloud.AWS).

from go-cloud.

Related Issues (20)

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.