-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathstrings.go
53 lines (40 loc) · 1020 Bytes
/
strings.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
package main
const (
functionComments = "// NewStatic%s initializes a new static.Files instance for use"
initStartFile = `//go:generate statics -i=%s -o=%s -pkg=%s -group=%s %s %s
package %s
import "github.com/go-playground/statics/static"
// newStatic%s initializes a new *static.Files instance for use
func newStatic%s(config *static.Config) (*static.Files, error) {
return static.New(config, &static.DirFile{
`
initEndfile = `})
}`
startFile = `//go:generate statics -i=%s -o=%s -pkg=%s -group=%s %s %s
package %s
import (
"os"
"github.com/go-playground/statics/static"
)
// newStatic%s initializes a new *static.Files instance for use
func newStatic%s(config *static.Config) (*static.Files, error) {
return static.New(config, `
endfile = `)
}`
dirFileEnd = `},
}`
dirFileEndArray = `},
},
`
)
var (
dirFileStart = `&static.DirFile{
Path: %q,
Name: "%s",
Size: %d,
Mode: os.FileMode(%d),
ModTime: %v,
IsDir: %t,
Compressed: ` + "`\n%s`" + `,
Files: []*static.DirFile{`
)