// the worker function run as a goroutine
the worker function run as a goroutine
// the worker function run as a goroutine
func fibWorker(wid uint64, inch chan dataEnvelope, outch chan dataEnvelope) {
	defer close(outch)
	var inDataTyped fibData
	for inData := range inch {
		inDataTyped = inData.(fibData)
		outData := fibData{inDataTyped.fibc, inDataTyped.fibp + inDataTyped.fibc}
		fmt.Printf("fibw-%d - fib(%v) = %v\n", wid, wid, inDataTyped.fibc)
		outch <- outData
	}
}
func fibWorker ( wid uint64 , inch chan dataEnvelope , outch chan dataEnvelope ) { defer close ( outch ) var inDataTyped fibData for inData := range inch { inDataTyped = inData . ( fibData ) outData := fibData { inDataTyped . fibc , inDataTyped . fibp + inDataTyped . fibc } fmt . Printf ( " \n " , wid , wid , inDataTyped . fibc ) outch <- outData } }
the worker function run as a goroutine
the worker function run as a goroutine
// prepare the data for the next worker // send the data to the next worker