-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen_oos.go
129 lines (104 loc) · 3.26 KB
/
gen_oos.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// Code generated by osa/gen. DO NOT EDIT.
package oos
import (
"io"
"io/fs"
"os"
)
type oos struct{}
// Open opens the named file.
func (oos) Open(name string) (fs.File, error) {
return os.Open(name)
}
// Lstat returns a FileInfo describing the named file.
func (oos) Stat(name string) (FileInfo, error) {
return os.Stat(name)
}
// IsExist returns a boolean indicating whether the error is known to report
// that a file or directory already exists.
func (oos) IsExist(err error) bool {
return os.IsExist(err)
}
// IsNotExist returns a boolean indicating whether the error is known to
// report that a file or directory does not exist.
func (oos) IsNotExist(err error) bool {
return os.IsNotExist(err)
}
// PathSeparator returns the directory separator character.
func (oos) PathSeparator() uint8 {
return PathSeparator()
}
// IsPathSeparator reports whether c is a directory separator character.
func (oos) IsPathSeparator(c uint8) bool {
return os.IsPathSeparator(c)
}
// Mkdir creates a new directory.
func (oos) Mkdir(name string, perm FileMode) error {
return os.Mkdir(name, perm)
}
// MkdirAll creates a directory named path, along with any necessary parents.
func (oos) MkdirAll(name string, perm FileMode) error {
return os.MkdirAll(name, perm)
}
// MkdirTemp creates a new temporary directory in the directory dir and
// returns the pathname of the new directory.
func (oos) MkdirTemp(dir, pattern string) (string, error) {
return os.MkdirTemp(dir, pattern)
}
// ReadDir reads the named directory and returns all its directory entries
// sorted by filename.
func (oos) ReadDir(name string) ([]DirEntry, error) {
return os.ReadDir(name)
}
// WriteFile writes data to the named file, creating it if necessary.
func (oos) WriteFile(name string, data []byte, perm FileMode) error {
return os.WriteFile(name, data, perm)
}
// ReadFile reads the named file and returns the contents.
func (oos) ReadFile(name string) ([]byte, error) {
return os.ReadFile(name)
}
// Rename renames (moves) oldpath to newpath.
func (oos) Rename(oldpath, newpath string) error {
return os.Rename(oldpath, newpath)
}
// Remove removes the named file or empty directory.
func (oos) Remove(name string) error {
return os.Remove(name)
}
// RemoveAll removes path and any children it contains
func (oos) RemoveAll(path string) error {
return os.RemoveAll(path)
}
// Getwd returns a rooted path name corresponding to the current directory.
func (oos) Getwd() (dir string, err error) {
return os.Getwd()
}
// UserCacheDir returns the default directory to use for cached data.
func (oos) UserCacheDir() (string, error) {
return os.UserCacheDir()
}
// UserConfigDir returns the default directory to use for configuration data.
func (oos) UserConfigDir() (string, error) {
return os.UserConfigDir()
}
// UserHomeDir returns the current user's home directory.
func (oos) UserHomeDir() (string, error) {
return os.UserHomeDir()
}
// Exit causes the current program to exit with the given status code.
func (oos) Exit(code int) {
os.Exit(code)
}
// Stdin returns IO reader for Stdin.
func (oos) Stdin() io.Reader {
return os.Stdin
}
// Stdout returns IO writer for Stdout.
func (oos) Stdout() io.Writer {
return os.Stdout
}
// Stderr returns IO writer for Stderr.
func (oos) Stderr() io.Writer {
return os.Stderr
}