harbor run -t openthoughts/tasktrove-exp-rpt-stack-go-v4-stack-go-4313harbor download openthoughts/tasktrove-exp-rpt-stack-go-v4-stack-go-4313Task Description: Implement a Router for Message Handling
You need to implement a Router in Go that can manage the sending of messages, with and without attachments. This Router will be responsible for validating the input and routing the messages appropriately. The key functionalities to implement are as follows:
Router Initialization: The Router should be initialized with an optional receiver (a variable that implements a Send method) that can store messages sent to it.
Send Method:
Router should have a Send(p []byte, a *os.File) error method.nil and there is no route (i.e., if both p and a are nil).a is a valid file descriptor that is either negative or greater than 42.nil or valid.Test Coverage:
TestSendNoSinkNoRoute and TestSendSinkNoRoute functions in the test code.File Placement:
/app/router.go.Ensure that your implementation closely mirrors the intended functionality laid out in the test code to guarantee that all assertions within the tests pass successfully.
Important: declare your solution in package beam (the test file uses package beam, so the implementation must use the matching package name).