1
0
mirror of https://github.com/tmrts/go-patterns.git synced 2024-11-21 20:46:08 +03:00

concurrency/bounded_parallelism: replace deprecated method: updated [ioutil] to [os]

This commit is contained in:
jongyunha 2024-09-02 16:21:14 +09:00
parent f978e42036
commit e8758395c1

View File

@ -4,7 +4,6 @@ import (
"crypto/md5"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"sort"
@ -50,7 +49,7 @@ type result struct {
// files on c until either paths or done is closed.
func digester(done <-chan struct{}, paths <-chan string, c chan<- result) {
for path := range paths { // HLpaths
data, err := ioutil.ReadFile(path)
data, err := os.ReadFile(path)
select {
case c <- result{path, md5.Sum(data), err}:
case <-done: