mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
all: move from os.IsFoo to errors.Is(err, ErrFoo)
This commit is contained in:
Vendored
+3
-1
@@ -1,13 +1,15 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
"io/fs"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
_, err := os.Open("non-exist")
|
||||
if !os.IsNotExist(err) {
|
||||
if !errors.Is(err, fs.ErrNotExist) {
|
||||
panic("should be non exist error")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user