Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 3 results for
goroutine
- Page 1
Re: Creating a generator (golang)
Programming
Computer Science
8 Years Ago
by vegaseat
…quot; // generator using a channel and a
goroutine
func fib(n int) chan int { // … { fmt.Println("A Fibonacci generator via channel/
goroutine
:") // function fib() returns a channel // …val) } } /* A Fibonacci generator via channel/
goroutine
: The first 3 Fibonacci numbers: 0 1 1 …
Creating a generator (golang)
Programming
Computer Science
8 Years Ago
by vegaseat
Generators are rather familiar objects in Python. Generators supply data on demand. Using Go you can create a generator with a
goroutine
and a channel. Here the
goroutine
is an anonymous function within a function, simple to implement.
Re: Google Go OOP
Community Center
Geeks' Lounge
9 Years Ago
by vegaseat
…() { // create a new channel ch := make(chan int) // launch Generate
goroutine
go Generate(ch) // get the first 10 primes for i…
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Meet People
Forums
Top Members
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC