Giter VIP home page Giter VIP logo

Comments (5)

emirpasic avatar emirpasic commented on July 22, 2024 1

@asdine looks like it's on the road map given the number of up votes

from gods.

emirpasic avatar emirpasic commented on July 22, 2024 1

#189 brings in the two new functions that can help achieve the above, i.e. NextTo() and PrevTo()

Given the above comment on requested functionality, this can now be achieved with:

	// Seek key-value pair whose value starts with "1234"
	seek := func(key interface{}, value interface{}) bool {
		return strings.HasSuffix(value.(string), "1234")
	}

	for found := it.NextTo(seek); found; found = it.Next() {
		key, value := it.Key(), it.Value()
		...
	} 

For a working example refer to: https://github.com/emirpasic/gods/blob/master/examples/iteratorwithkey/iteratorwithkey.go#L71-L80

Please let me know if the above is not what was requested so I can reopen this issue.

from gods.

emirpasic avatar emirpasic commented on July 22, 2024

@zhengxiaochuan-3 sure, let's keep this issue open and see if more people vote for it.

from gods.

asdine avatar asdine commented on July 22, 2024

Any plan for this feature?

from gods.

emirpasic avatar emirpasic commented on July 22, 2024

Related to #95

from gods.

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.