@@ -46,10 +46,10 @@ Options:
46
46
` [1 :]
47
47
48
48
var (
49
- pkg string
50
- importPrefix string
51
- outFile string
52
- pluginDirs stringSliceFlag
49
+ pkg string
50
+ importPrefix string
51
+ outFile string
52
+ pluginDirs stringSliceFlag
53
53
)
54
54
55
55
func init () {
@@ -69,7 +69,7 @@ func main() {
69
69
}
70
70
71
71
// Build import paths.
72
- var imports = map [string ]util.KV {}
72
+ var imports = map [string ]util.KV {}
73
73
for _ , dir := range pluginDirs {
74
74
75
75
libRegEx , e := regexp .Compile (".*.go$" )
@@ -79,7 +79,7 @@ func main() {
79
79
80
80
e = filepath .Walk (dir , func (path string , info os.FileInfo , err error ) error {
81
81
82
- if path == outFile {
82
+ if path == outFile {
83
83
return nil
84
84
}
85
85
@@ -90,7 +90,7 @@ func main() {
90
90
}
91
91
if hasInitMethod (filepath .Join (path )) {
92
92
imports [filepath .ToSlash (
93
- filepath .Join (importPrefix , filepath .Dir (path )))] = util.KV {}
93
+ filepath .Join (importPrefix , filepath .Dir (path )))] = util.KV {}
94
94
95
95
return nil
96
96
}
@@ -102,13 +102,13 @@ func main() {
102
102
}
103
103
}
104
104
105
- importKeys := util .GetMapKeys (imports )
105
+ importKeys := util .GetMapKeys (imports )
106
106
107
107
// Populate the template.
108
108
var buf bytes.Buffer
109
109
err := Template .Execute (& buf , Data {
110
- Package : pkg ,
111
- Imports : importKeys ,
110
+ Package : pkg ,
111
+ Imports : importKeys ,
112
112
})
113
113
if err != nil {
114
114
log .Fatalf ("Failed executing template: %v" , err )
@@ -133,7 +133,7 @@ func usageFlag() {
133
133
var Template = template .Must (template .New ("normalizations" ).Funcs (map [string ]interface {}{
134
134
"trim" : strings .TrimSpace ,
135
135
}).Parse (
136
- `/// GENERATED CODE BY PLUGIN DISCOVERY- DO NOT EDIT.
136
+ `/// GENERATED CODE BY PLUGIN DISCOVERY- DO NOT EDIT.
137
137
138
138
package {{ .Package }}
139
139
@@ -145,11 +145,11 @@ import (
145
145
` [1 :]))
146
146
147
147
type Data struct {
148
- Package string
149
- Imports []string
148
+ Package string
149
+ Imports []string
150
150
}
151
151
152
- //stringSliceFlag is a flag type that allows more than one value to be specified.
152
+ // stringSliceFlag is a flag type that allows more than one value to be specified.
153
153
type stringSliceFlag []string
154
154
155
155
func (f * stringSliceFlag ) String () string { return strings .Join (* f , "," ) }
@@ -183,7 +183,6 @@ func hasInitMethod(file string) bool {
183
183
return false
184
184
}
185
185
186
-
187
186
// FindFiles return a list of file matching the given glob patterns.
188
187
func FindFiles (globs ... string ) ([]string , error ) {
189
188
var configFiles []string
0 commit comments