mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-18 20:50:12 +08:00
fix: make lint&ci happy
This commit is contained in:
parent
d2e6c9780f
commit
8825514fb2
1
.github/workflows/nightly.yml
vendored
1
.github/workflows/nightly.yml
vendored
@ -45,7 +45,6 @@ jobs:
|
||||
GOARCH: ${{ matrix.goarch }}
|
||||
IS_PR: ${{ !!github.head_ref }}
|
||||
run: |
|
||||
if [ ! -f custom/register.go ]; then touch custom/register.go; fi
|
||||
go generate ./...
|
||||
if [ $GOOS = "windows" ]; then export BINARY_SUFFIX="$BINARY_SUFFIX.exe"; fi
|
||||
if $IS_PR ; then echo $PR_PROMPT; fi
|
||||
|
||||
1
.github/workflows/pull.yml
vendored
1
.github/workflows/pull.yml
vendored
@ -36,7 +36,6 @@ jobs:
|
||||
- name: Tidy Modules
|
||||
run: |
|
||||
go mod tidy
|
||||
if [ ! -f custom/register.go ]; then touch custom/register.go; fi
|
||||
go generate ./...
|
||||
|
||||
- name: golangci-lint
|
||||
|
||||
1
.github/workflows/push.yml
vendored
1
.github/workflows/push.yml
vendored
@ -16,7 +16,6 @@ jobs:
|
||||
- name: Tidy Modules
|
||||
run: |
|
||||
go mod tidy
|
||||
if [ ! -f custom/register.go ]; then touch custom/register.go; fi
|
||||
go generate ./...
|
||||
|
||||
- name: Run Lint
|
||||
|
||||
@ -4,7 +4,6 @@ env:
|
||||
before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
- if [ ! -f custom/register.go ]; then touch custom/register.go; fi
|
||||
- go generate ./...
|
||||
- go install github.com/tc-hib/go-winres@latest
|
||||
- go-winres make
|
||||
|
||||
51
abineundo/ref/main.go
Normal file
51
abineundo/ref/main.go
Normal file
@ -0,0 +1,51 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"io"
|
||||
"os"
|
||||
"path"
|
||||
)
|
||||
|
||||
func main() {
|
||||
root := flag.String("r", "", "project root dir")
|
||||
flag.Parse()
|
||||
|
||||
fi, err := os.Open(path.Join(*root, "main.go"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fo, err := os.Create(path.Join(*root, "abineundo/ref/main/main.go"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
_, err = io.Copy(fo, fi)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fi.Close()
|
||||
fo.Close()
|
||||
|
||||
regf := path.Join(*root, "custom/register.go")
|
||||
if _, err := os.Stat(regf); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return
|
||||
}
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fi, err = os.Open(regf)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fo, err = os.Create(path.Join(*root, "abineundo/ref/custom/register.go"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
_, err = io.Copy(fo, fi)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fi.Close()
|
||||
fo.Close()
|
||||
}
|
||||
@ -1,4 +1,2 @@
|
||||
// Package custom 注册用户自定义插件于此
|
||||
package custom
|
||||
|
||||
//go:generate cp register.go ../abineundo/ref/custom
|
||||
|
||||
@ -10,7 +10,7 @@ import (
|
||||
"github.com/FloatTech/ZeroBot-Plugin/kanban/banner"
|
||||
)
|
||||
|
||||
//go:generate go run github.com/FloatTech/ZeroBot-Plugin/kanban/gen
|
||||
//go:generate env GOOS= GOARCH= go run github.com/FloatTech/ZeroBot-Plugin/kanban/gen
|
||||
|
||||
func init() {
|
||||
PrintBanner()
|
||||
|
||||
2
main.go
2
main.go
@ -1,7 +1,7 @@
|
||||
// Package main ZeroBot-Plugin main file
|
||||
package main
|
||||
|
||||
//go:generate cp main.go abineundo/ref/main
|
||||
//go:generate env GOOS= GOARCH= go run github.com/FloatTech/ZeroBot-Plugin/abineundo/ref -r .
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Package winres 生成windows资源
|
||||
package winres
|
||||
|
||||
//go:generate go run github.com/FloatTech/ZeroBot-Plugin/winres/gen
|
||||
//go:generate env GOOS= GOARCH= go run github.com/FloatTech/ZeroBot-Plugin/winres/gen
|
||||
|
||||
Loading…
Reference in New Issue
Block a user