GithubHelp home page GithubHelp logo

Comments (7)

GeertJohan avatar GeertJohan commented on June 9, 2024

I think this could be usefull indeed.
It's ofcourse important to not break existing code using rice.
I think a lookup preference per FindBox call would be best (so not globally configurable). Then it would create something like rice.FindBoxLookup("boxName", rice.LookupFS, rice.LookupAppended, rice.LookupEmbedded).

Those LookupFS, LookupAppended etc could be typed constants:
type LookupPreference int
const LookupFS = LookupPreference(1)

That would make the function definition something like this:
func FindBoxLookup(boxName string, lookupPrefs []LookupPreference...)

Or maybe:

func FindBoxWithConfig(boxName string, config *FindBoxConfig)
type FindBoxConfig struct{
  LookupOrder []LookupPreference
}

What are yout thoughts about this?

I'm at vacation now, only a phone. Would be happy to take a PR though.

from go.rice.

GeertJohan avatar GeertJohan commented on June 9, 2024

Or maybe: func (c *Config) FindBox(boxName string) with Config being the same as above.

I like the type Config because it's likely that more options will be added in the future.

from go.rice.

augustoroman avatar augustoroman commented on June 9, 2024

I like the Config approach too.

from go.rice.

GeertJohan avatar GeertJohan commented on June 9, 2024

Great! Are you willing to create this feature?

from go.rice.

augustoroman avatar augustoroman commented on June 9, 2024

Yes, I'll take a stab at it later this week.

from go.rice.

GeertJohan avatar GeertJohan commented on June 9, 2024

Great, looking forward to it!

from go.rice.

GeertJohan avatar GeertJohan commented on June 9, 2024

This has been fixed by #19

from go.rice.

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.