Skip to content

Commit 2994ff3

Browse files
author
Jacob H. Haven
committed
cli/serve: manually fix style errors in autogenerated static file code
1 parent eb37134 commit 2994ff3

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

cli/serve/static.go

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ import (
1111
"time"
1212
)
1313

14-
type _esc_localFS struct{}
14+
type escLocalFS struct{}
1515

16-
var _esc_local _esc_localFS
16+
var escLocal escLocalFS
1717

18-
type _esc_staticFS struct{}
18+
type escStaticFS struct{}
1919

20-
var _esc_static _esc_staticFS
20+
var escStatic escStaticFS
2121

22-
type _esc_file struct {
22+
type escFile struct {
2323
compressed string
2424
size int64
2525
local string
@@ -30,16 +30,16 @@ type _esc_file struct {
3030
name string
3131
}
3232

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)]
3535
if !present {
3636
return nil, os.ErrNotExist
3737
}
3838
return os.Open(f.local)
3939
}
4040

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)]
4343
if !present {
4444
return nil, os.ErrNotExist
4545
}
@@ -62,81 +62,81 @@ func (_esc_staticFS) prepare(name string) (*_esc_file, error) {
6262
return f, nil
6363
}
6464

65-
func (fs _esc_staticFS) Open(name string) (http.File, error) {
65+
func (fs escStaticFS) Open(name string) (http.File, error) {
6666
f, err := fs.prepare(name)
6767
if err != nil {
6868
return nil, err
6969
}
7070
return f.File()
7171
}
7272

73-
func (f *_esc_file) File() (http.File, error) {
73+
func (f *escFile) File() (http.File, error) {
7474
type httpFile struct {
7575
*bytes.Reader
76-
*_esc_file
76+
*escFile
7777
}
7878
return &httpFile{
79-
Reader: bytes.NewReader(f.data),
80-
_esc_file: f,
79+
Reader: bytes.NewReader(f.data),
80+
escFile: f,
8181
}, nil
8282
}
8383

84-
func (f *_esc_file) Close() error {
84+
func (f *escFile) Close() error {
8585
return nil
8686
}
8787

88-
func (f *_esc_file) Readdir(count int) ([]os.FileInfo, error) {
88+
func (f *escFile) Readdir(count int) ([]os.FileInfo, error) {
8989
return nil, nil
9090
}
9191

92-
func (f *_esc_file) Stat() (os.FileInfo, error) {
92+
func (f *escFile) Stat() (os.FileInfo, error) {
9393
return f, nil
9494
}
9595

96-
func (f *_esc_file) Name() string {
96+
func (f *escFile) Name() string {
9797
return f.name
9898
}
9999

100-
func (f *_esc_file) Size() int64 {
100+
func (f *escFile) Size() int64 {
101101
return f.size
102102
}
103103

104-
func (f *_esc_file) Mode() os.FileMode {
104+
func (f *escFile) Mode() os.FileMode {
105105
return 0
106106
}
107107

108-
func (f *_esc_file) ModTime() time.Time {
108+
func (f *escFile) ModTime() time.Time {
109109
return time.Time{}
110110
}
111111

112-
func (f *_esc_file) IsDir() bool {
112+
func (f *escFile) IsDir() bool {
113113
return f.isDir
114114
}
115115

116-
func (f *_esc_file) Sys() interface{} {
116+
func (f *escFile) Sys() interface{} {
117117
return f
118118
}
119119

120120
// FS returns a http.Filesystem for the embedded assets. If useLocal is true,
121121
// the filesystem's contents are instead used.
122122
func FS(useLocal bool) http.FileSystem {
123123
if useLocal {
124-
return _esc_local
124+
return escLocal
125125
}
126-
return _esc_static
126+
return escStatic
127127
}
128128

129129
// FSByte returns the named file from the embedded assets. If useLocal is
130130
// true, the filesystem's contents are instead used.
131131
func FSByte(useLocal bool, name string) ([]byte, error) {
132132
if useLocal {
133-
f, err := _esc_local.Open(name)
133+
f, err := escLocal.Open(name)
134134
if err != nil {
135135
return nil, err
136136
}
137137
return ioutil.ReadAll(f)
138138
}
139-
f, err := _esc_static.prepare(name)
139+
f, err := escStatic.prepare(name)
140140
if err != nil {
141141
return nil, err
142142
}
@@ -163,7 +163,7 @@ func FSMustString(useLocal bool, name string) string {
163163
return string(FSMustByte(useLocal, name))
164164
}
165165

166-
var _esc_data = map[string]*_esc_file{
166+
var escData = map[string]*escFile{
167167

168168
"/index.html": {
169169
local: "cli/serve/static/index.html",

0 commit comments

Comments
 (0)