@@ -11,15 +11,15 @@ import (
11
11
"time"
12
12
)
13
13
14
- type _esc_localFS struct {}
14
+ type escLocalFS struct {}
15
15
16
- var _esc_local _esc_localFS
16
+ var escLocal escLocalFS
17
17
18
- type _esc_staticFS struct {}
18
+ type escStaticFS struct {}
19
19
20
- var _esc_static _esc_staticFS
20
+ var escStatic escStaticFS
21
21
22
- type _esc_file struct {
22
+ type escFile struct {
23
23
compressed string
24
24
size int64
25
25
local string
@@ -30,16 +30,16 @@ type _esc_file struct {
30
30
name string
31
31
}
32
32
33
- func (_esc_localFS ) Open (name string ) (http.File , error ) {
34
- f , present := _esc_data [path .Clean (name )]
33
+ func (escLocalFS ) Open (name string ) (http.File , error ) {
34
+ f , present := escData [path .Clean (name )]
35
35
if ! present {
36
36
return nil , os .ErrNotExist
37
37
}
38
38
return os .Open (f .local )
39
39
}
40
40
41
- func (_esc_staticFS ) prepare (name string ) (* _esc_file , error ) {
42
- f , present := _esc_data [path .Clean (name )]
41
+ func (escStaticFS ) prepare (name string ) (* escFile , error ) {
42
+ f , present := escData [path .Clean (name )]
43
43
if ! present {
44
44
return nil , os .ErrNotExist
45
45
}
@@ -62,81 +62,81 @@ func (_esc_staticFS) prepare(name string) (*_esc_file, error) {
62
62
return f , nil
63
63
}
64
64
65
- func (fs _esc_staticFS ) Open (name string ) (http.File , error ) {
65
+ func (fs escStaticFS ) Open (name string ) (http.File , error ) {
66
66
f , err := fs .prepare (name )
67
67
if err != nil {
68
68
return nil , err
69
69
}
70
70
return f .File ()
71
71
}
72
72
73
- func (f * _esc_file ) File () (http.File , error ) {
73
+ func (f * escFile ) File () (http.File , error ) {
74
74
type httpFile struct {
75
75
* bytes.Reader
76
- * _esc_file
76
+ * escFile
77
77
}
78
78
return & httpFile {
79
- Reader : bytes .NewReader (f .data ),
80
- _esc_file : f ,
79
+ Reader : bytes .NewReader (f .data ),
80
+ escFile : f ,
81
81
}, nil
82
82
}
83
83
84
- func (f * _esc_file ) Close () error {
84
+ func (f * escFile ) Close () error {
85
85
return nil
86
86
}
87
87
88
- func (f * _esc_file ) Readdir (count int ) ([]os.FileInfo , error ) {
88
+ func (f * escFile ) Readdir (count int ) ([]os.FileInfo , error ) {
89
89
return nil , nil
90
90
}
91
91
92
- func (f * _esc_file ) Stat () (os.FileInfo , error ) {
92
+ func (f * escFile ) Stat () (os.FileInfo , error ) {
93
93
return f , nil
94
94
}
95
95
96
- func (f * _esc_file ) Name () string {
96
+ func (f * escFile ) Name () string {
97
97
return f .name
98
98
}
99
99
100
- func (f * _esc_file ) Size () int64 {
100
+ func (f * escFile ) Size () int64 {
101
101
return f .size
102
102
}
103
103
104
- func (f * _esc_file ) Mode () os.FileMode {
104
+ func (f * escFile ) Mode () os.FileMode {
105
105
return 0
106
106
}
107
107
108
- func (f * _esc_file ) ModTime () time.Time {
108
+ func (f * escFile ) ModTime () time.Time {
109
109
return time.Time {}
110
110
}
111
111
112
- func (f * _esc_file ) IsDir () bool {
112
+ func (f * escFile ) IsDir () bool {
113
113
return f .isDir
114
114
}
115
115
116
- func (f * _esc_file ) Sys () interface {} {
116
+ func (f * escFile ) Sys () interface {} {
117
117
return f
118
118
}
119
119
120
120
// FS returns a http.Filesystem for the embedded assets. If useLocal is true,
121
121
// the filesystem's contents are instead used.
122
122
func FS (useLocal bool ) http.FileSystem {
123
123
if useLocal {
124
- return _esc_local
124
+ return escLocal
125
125
}
126
- return _esc_static
126
+ return escStatic
127
127
}
128
128
129
129
// FSByte returns the named file from the embedded assets. If useLocal is
130
130
// true, the filesystem's contents are instead used.
131
131
func FSByte (useLocal bool , name string ) ([]byte , error ) {
132
132
if useLocal {
133
- f , err := _esc_local .Open (name )
133
+ f , err := escLocal .Open (name )
134
134
if err != nil {
135
135
return nil , err
136
136
}
137
137
return ioutil .ReadAll (f )
138
138
}
139
- f , err := _esc_static .prepare (name )
139
+ f , err := escStatic .prepare (name )
140
140
if err != nil {
141
141
return nil , err
142
142
}
@@ -163,7 +163,7 @@ func FSMustString(useLocal bool, name string) string {
163
163
return string (FSMustByte (useLocal , name ))
164
164
}
165
165
166
- var _esc_data = map [string ]* _esc_file {
166
+ var escData = map [string ]* escFile {
167
167
168
168
"/index.html" : {
169
169
local : "cli/serve/static/index.html" ,
0 commit comments