|
|
|
|
|
by dannas
2160 days ago
|
|
Can you make the distinction between "centralization" vs "composition" of errors? Do you mean the fact that there must be some if-statement within the API that reacts to the different errors and sets a flag used by the Err() method? Is you opinion that "composition of errors" always requires special syntactic elements such as the match statement? The code from the blog section: scanner := bufio.NewScanner(input)
for scanner.Scan() {
token := scanner.Text()
// process token
}
if err := scanner.Err(); err != nil {
// process the error
}
|
|