cannot use function (type func()) as type in argument to Golang :     package main
    
    import (
    	"log"
    	"strings"
    
    	"go.scope.charter.com/busboy"
    )
    
    /*
    Trivial service to demonstrate chaining service together
    Message starts in originator, travels through a couple formatters, and then gets back to originator
    */
    
    type MessageTest struct {
    	Body string `json:"body"`
    }
    var s *busboy.Service
    func main() {
    	var (
    		err error
    		cid string
    	)
    	//var m MessageDelivery
           var g busboy.MessageHandler
           g = UpperCaseHandler
    
    	//	UpperCaser := busboy.NewService("UpperCaser", "", false)
    	UpperCaser := busboy.NewService("UpperCaser")
    	if err = UpperCaser.ConsumeFunc("rio-service-uc", []string{"rio-service-uc"},func() interface{} {
    		return ""
    	},g); err != nil {
    		log.Fatalf("Error starting consumer: %v", err)
    	}
    	//	Repeater := busboy.NewService("Repeater", "", false)
    	Repeater := busboy.NewService("Repeater")
    	if err = Repeater.ConsumeFunc("rio-service-repeat", []string{"rio-service-repeat"}, func() interface{} {
    		return ""
    	}, RepeatHandler); err != nil {
    		//if err = Repeater.ConsumeFunc("rio-service-repeat", []string{"rio-service-repeat"}, mg busboy.MessageGenerator, mh busboy.MessageHandler); err != nil {
    		log.Fatalf("Error starting consumer: %v", err)
    	}
    
    	//	originator := busboy.NewService("Originator", "", false)
    	originator := busboy.NewService("Originator")
    
    	deliveryChan := make(chan busboy.MessageDelivery)
    	m := busboy.MessagePublishing{
    		Message:     MessageTest{"this is a test"},
    		RoutingKeys: []string{"rio-service-uc", "rio-service-repeat"},
    	}
    	if cid, err = originator.RPCPublish(m, deliveryChan); err != nil {
    		log.Fatalf("Failed to publish: %v", err)
    	}
    
    	message := <-deliveryChan
    	log.Printf("Originator Got: %+v", message.Message)
    	originator.RemoveQueue(cid)
    	UpperCaser.Wait()
    }
    
    func UpperCaseHandler(md busboy.MessageDelivery) {
    	 s.Reply(MessageTest{strings.ToUpper(md.Message.(string))}, md.Delivery)
    }
    
    func RepeatHandler(md busboy.MessageDelivery) {
    	 s.Reply(MessageTest{strings.Repeat(md.Message.(string), 5)}, md.Delivery)
    }


    package busboy




>     Error 
> 
>./chains.go:26:10: cannot use UpperCaseHandler      (typefunc(busboy.MessageDelivery)) as type busboy.MessageHandler in
> assignment
>./chains.go:37:86: cannot use RepeatHandler (type func(busboy.MessageDelivery)) as type busboy.MessageHandler in
> argument to Repeater.ConsumeFunc


    type MessageDelivery struct {
    	Delivery amqp.Delivery
    	Message  interface{}
    	Error    error
    	Context  *Context
    }    
    type MessageGenerator func() interface{}



> I tried running the code,where am i going wrong,how do i right pass
> function as argument to another function. The function returns
> interface and error. Though function is taking MessageDelivery Struct as argument,function signature is same.where am i going wrong