(prefix string, end int, wg *sync.WaitGroup, exit func(error))
| 71 | } |
| 72 | |
| 73 | func dlrange(prefix string, end int, wg *sync.WaitGroup, exit func(error)) []string { |
| 74 | if file.IsNotExist(datapath + `materials/` + prefix) { |
| 75 | err := os.MkdirAll(datapath+`materials/`+prefix, 0755) |
| 76 | if err != nil { |
| 77 | exit(err) |
| 78 | return nil |
| 79 | } |
| 80 | } |
| 81 | c := make([]string, end) |
| 82 | for i := range c { |
| 83 | wg.Add(1) |
| 84 | go dlchan(prefix+"/"+strconv.Itoa(i)+".png", &c[i], wg, exit) |
| 85 | } |
| 86 | return c |
| 87 | } |
| 88 | |
| 89 | // 新的上下文 |
| 90 | func newContext(user int64, atUser int64) *context { |
no test coverage detected