diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/options/main.go | 23 | ||||
-rw-r--r-- | modules/options/options.go | 2 | ||||
-rw-r--r-- | modules/options/options_bindata.go | 9 | ||||
-rw-r--r-- | modules/public/main.go | 23 | ||||
-rw-r--r-- | modules/public/public.go | 2 | ||||
-rw-r--r-- | modules/public/public_bindata.go | 9 | ||||
-rw-r--r-- | modules/templates/main.go | 23 | ||||
-rw-r--r-- | modules/templates/templates_bindata.go (renamed from modules/templates/templates.go) | 4 |
8 files changed, 21 insertions, 74 deletions
diff --git a/modules/options/main.go b/modules/options/main.go deleted file mode 100644 index 0bc6c04e24..0000000000 --- a/modules/options/main.go +++ /dev/null @@ -1,23 +0,0 @@ -// +build ignore - -package main - -import ( - "log" - "net/http" - - "github.com/shurcooL/vfsgen" -) - -func main() { - var fsTemplates http.FileSystem = http.Dir("../../options") - err := vfsgen.Generate(fsTemplates, vfsgen.Options{ - PackageName: "options", - BuildTags: "bindata", - VariableName: "Assets", - Filename: "bindata.go", - }) - if err != nil { - log.Fatal("%v", err) - } -} diff --git a/modules/options/options.go b/modules/options/options.go index 62e8c041bd..6ba3bd6a86 100644 --- a/modules/options/options.go +++ b/modules/options/options.go @@ -4,8 +4,6 @@ package options -//go:generate go run -mod=vendor main.go - type directorySet map[string][]string func (s directorySet) Add(key string, value []string) { diff --git a/modules/options/options_bindata.go b/modules/options/options_bindata.go new file mode 100644 index 0000000000..a5143c1fff --- /dev/null +++ b/modules/options/options_bindata.go @@ -0,0 +1,9 @@ +// Copyright 2020 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +//+build bindata + +package options + +//go:generate go run -mod=vendor ../../scripts/generate-bindata.go ../../options options bindata.go diff --git a/modules/public/main.go b/modules/public/main.go deleted file mode 100644 index 707dbe2b22..0000000000 --- a/modules/public/main.go +++ /dev/null @@ -1,23 +0,0 @@ -// +build ignore - -package main - -import ( - "log" - "net/http" - - "github.com/shurcooL/vfsgen" -) - -func main() { - var fsPublic http.FileSystem = http.Dir("../../public") - err := vfsgen.Generate(fsPublic, vfsgen.Options{ - PackageName: "public", - BuildTags: "bindata", - VariableName: "Assets", - Filename: "bindata.go", - }) - if err != nil { - log.Fatal("%v", err) - } -} diff --git a/modules/public/public.go b/modules/public/public.go index c16c8e0009..2617d31aea 100644 --- a/modules/public/public.go +++ b/modules/public/public.go @@ -18,8 +18,6 @@ import ( "gitea.com/macaron/macaron" ) -//go:generate go run -mod=vendor main.go - // Options represents the available options to configure the macaron handler. type Options struct { Directory string diff --git a/modules/public/public_bindata.go b/modules/public/public_bindata.go new file mode 100644 index 0000000000..68a786c767 --- /dev/null +++ b/modules/public/public_bindata.go @@ -0,0 +1,9 @@ +// Copyright 2020 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +//+build bindata + +package public + +//go:generate go run -mod=vendor ../../scripts/generate-bindata.go ../../public public bindata.go diff --git a/modules/templates/main.go b/modules/templates/main.go deleted file mode 100644 index 4460f58cbf..0000000000 --- a/modules/templates/main.go +++ /dev/null @@ -1,23 +0,0 @@ -// +build ignore - -package main - -import ( - "log" - "net/http" - - "github.com/shurcooL/vfsgen" -) - -func main() { - var fsTemplates http.FileSystem = http.Dir("../../templates") - err := vfsgen.Generate(fsTemplates, vfsgen.Options{ - PackageName: "templates", - BuildTags: "bindata", - VariableName: "Assets", - Filename: "bindata.go", - }) - if err != nil { - log.Fatal("%v", err) - } -} diff --git a/modules/templates/templates.go b/modules/templates/templates_bindata.go index af6bf010c1..eaf64d9457 100644 --- a/modules/templates/templates.go +++ b/modules/templates/templates_bindata.go @@ -2,6 +2,8 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. +//+build bindata + package templates -//go:generate go run -mod=vendor main.go +//go:generate go run -mod=vendor ../../scripts/generate-bindata.go ../../templates templates bindata.go |