21 }
22}
23
24func TestExpandUser(t *testing.T) {25 fmt.Println(ExpandUser("~/.gocryptotrader/config.json"))
26}
21}
22
23// HandleTwapTask handles a task for TWAP algorithm.
24func HandleTwapTask(ctx context.Context, t *asynq.Task) error {25 var p Payload
26 err := json.Unmarshal(t.Payload(), &p)
27 if err != nil {
19 return asynq.NewTask(TypeOrder, payload), nil
20}
21
22func HandleOrderTask(ctx context.Context, task *asynq.Task) error {23 var o *order.Submit // order.Submit
24 err := json.Unmarshal(task.Payload(), &o)
25 if err != nil {
Unused parameters in functions or methods should be replaced with _
(underscore) or removed.
Functions or methods with unused parameters can be a symptom of unfinished
refactoring or a bug. If an unused parameter is present, it should be named _
(underscore) to avoid raising this issue and better readability.
func abc(unused string) {
fmt.Println("Not using any passed params.")
}
func abc(_ string) {
fmt.Println("Not using any passed params.")
}
func abc() {
fmt.Println("Not using any passed params.")
}