Giter Site home page Giter Site logo

Comments (6)

willbeason avatar willbeason commented on June 27, 2024 1

The ones I've found are:

  • "v1"
  • "v1alpha1"
  • "v1beta1"
  • "constraints.gatekeeper.sh"
  • "templates.gatekeeper.sh"
  • "externaldata.gatekeeper.sh"

For the /api/ locations, the appropriate place is in a declaration like:

	SchemeGroupVersion = schema.GroupVersion{Group: "externaldata.gatekeeper.sh", Version: "v1alpha1"}

In some cases, we define a constant but the code doesn't use it. For example "ProviderRequest" has a definition in constraint/pkg/externaldata/request.go but it isn't referenced in the same file.

"data.lib" and "data.inventory" aren't repeated a bunch of times, but they're so important we should have them as constants so it's clear that their repetition in both "main.go" and "client.go" is meaningful and can't accidentally be broken.

That's everything I could find. There might be more (feel free to look if you want).

from frameworks.

willbeason avatar willbeason commented on June 27, 2024

goconst is a great tool for discovering these. Don't worry about getting every instance - just the ones that make sense/are important to flow.

go get github.com/jgautheron/goconst/cmd/goconst

goconst -ignore "remote" ./pkg/... | sort

Anything in client/drivers/remote is safe to ignore

from frameworks.

willbeason avatar willbeason commented on June 27, 2024

Also "data" since we define it as the root object users reference, so it pops up in a bunch of locations.

from frameworks.

maxsmythe avatar maxsmythe commented on June 27, 2024

Is this a blocker for sharding?

from frameworks.

becky-hd avatar becky-hd commented on June 27, 2024

Moving constants to pkg/apis seems reasonable

from frameworks.

willbeason avatar willbeason commented on June 27, 2024

Mostly done as parts of various PRs.

from frameworks.

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.