gitee.com/sy_183/go-common@v1.0.5-0.20231205030221-958cfe129b47/errors/task-full.go (about) 1 package errors 2 3 import "fmt" 4 5 type TaskFull struct { 6 Action string 7 MaxTask int 8 } 9 10 func (e *TaskFull) Error() string { 11 if e == nil { 12 return "<nil>" 13 } 14 if e.MaxTask != 0 { 15 return fmt.Sprintf("%s任务已满,最大任务数为%d", e.Action, e.MaxTask) 16 } else { 17 return fmt.Sprintf("%s任务已满", e.Action) 18 } 19 }